[openstack-dev] [oslo] oslo.concurrency repo review
Yuriy Taraday
yorik.sar at gmail.com
Mon Aug 11 18:02:22 UTC 2014
On Mon, Aug 11, 2014 at 5:44 AM, Joshua Harlow <harlowja at outlook.com> wrote:
> One question from me:
>
> Will there be later fixes to remove oslo.config dependency/usage from
> oslo.concurrency?
>
> I still don't understand how oslo.concurrency can be used as a library
> with the configuration being set in a static manner via oslo.config (let's
> use the example of `lock_path` @ https://github.com/YorikSar/
> oslo.concurrency/blob/master/oslo/concurrency/lockutils.py#L41). For
> example:
>
> Library X inside application Z uses lockutils (via the nice
> oslo.concurrency library) and sets the configuration `lock_path` to its
> desired settings, then library Y (also a user of oslo.concurrency) inside
> same application Z sets the configuration for `lock_path` to its desired
> settings. Now both have some unknown set of configuration they have set and
> when library X (or Y) continues to use lockutils they will be using some
> mix of configuration (likely some mish mash of settings set by X and Y);
> perhaps to a `lock_path` that neither actually wants to be able to write
> to...
>
> This doesn't seem like it will end well; and will just cause headaches
> during debug sessions, testing, integration and more...
>
> The same question can be asked about the `set_defaults()` function, how is
> library Y or X expected to use this (are they?)??
>
> I hope one of the later changes is to remove/fix this??
>
> Thoughts?
>
> -Josh
I'd be happy to remove lock_path config variable altogether. It's basically
never used. There are two basic branches in code wrt lock_path:
- when you provide lock_path argument to lock (and derivative functions),
file-based lock is used and CONF.lock_path is ignored;
- when you don't provide lock_path in arguments, semaphore-based lock is
used and CONF.lock_path is just a prefix for its name (before hashing).
I wonder if users even set lock_path in their configs as it has almost no
effect. So I'm all for removing it, but...
>From what I understand, every major change in lockutils drags along a lot
of headache for everybody (and risk of bugs that would be discovered very
late). So is such change really worth it? And if so, it will require very
thorough research of lockutils usage patterns.
--
Kind regards, Yuriy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140811/9d8d8a53/attachment.html>
More information about the OpenStack-dev
mailing list