Re: [openstack-dev] [oslo][oslo.service] looping.RetryDecorator behavior

2017-10-01 Thread Renat Akhmerov
Ok, thanks Josh. We switched to tenacity and it works very well for us )

Renat Akhmerov
@Nokia

On 23 Sep 2017, 11:51 +0700, Joshua Harlow , wrote:
> Hi Renat,
>
> I was more just saying that depending on your situation it might be
> better to switch to using tenacity (not that the retry decorator is
> deprecated, though I wouldn't personally use it).
>
> As you mentioned in
> https://bugs.launchpad.net/oslo.service/+bug/1718635/comments/1 this
> class and decorator is not thread safe so if that is a concern for you
> then that is also better in tenacity.
>
> I think a lot of usage of that decorator though is like the following:
>
> def main_func():
>
> @loopingcall.RetryDecorator
> def inner_func():
> 
>  inner_func()
> 
> So likely thread-safety was never a concern, though I can't quite say...
> I think (but I might be wrong) when that class/code was being proposed I
> recommended just using 'retrying' (the precursor to tenacity) but
> bygones be bygones...
>
> Renat Akhmerov wrote:
> > Thanks Josh,
> >
> > I’m not sure I fully understand your point though. You mean it’s a
> > legacy (deprecated?) code that we should never use in our code? Should
> > it be considered a private class of oslo_service?
> >
> > In our global requirements tenacity is configured as "tenacity>=3.2.1”,
> > should we bump it to 4.4.0?
> >
> > Renat Akhmerov
> > @Nokia
> >
> > On 21 Sep 2017, 22:42 +0700, Joshua Harlow , wrote:
> > > It does look like is sort of a bug,
> > >
> > > Though in all honesty I wouldn't be using oslo.service or that looping
> > > code in the future for doing retrying...
> > >
> > > https://pypi.python.org/pypi/tenacity is a much better library with more
> > > `natural` syntax and works more as one would expect (even under threaded
> > > situations).
> > >
> > > If I could of I would of never let 'loopingcall.py' become a file that
> > > exists, but the past is the past, ha.
> > >
> > > Renat Akhmerov wrote:
> > > > Hi Oslo team,
> > > >
> > > > Can you please check the bug [1]?
> > > >
> > > > There may be a problem with how looping.RetryDecorator works. Just
> > > > stumbled on it in Mistral. Not sure if it’s really a bug or made by
> > > > design. If it’s by design then maybe we need to have more accurate
> > > > documentation for it.
> > > >
> > > > FYI: We use this decorator in Mistral and it’s also used in Nova, [2].
> > > >
> > > > [1] https://bugs.launchpad.net/oslo.service/+bug/1718635
> > > > [2]
> > > > http://git.openstack.org/cgit/openstack/nova/tree/nova/virt/disk/mount/api.py
> > > >
> > > > Thanks
> > > >
> > > > Renat Akhmerov
> > > > @Nokia
> > > >
> > > > __
> > > > OpenStack Development Mailing List (not for usage questions)
> > > > Unsubscribe:
> > > > openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> > > > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> > >
> > > __
> > > OpenStack Development Mailing List (not for usage questions)
> > > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> > > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> > __
> > OpenStack Development Mailing List (not for usage questions)
> > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [oslo][oslo.service] looping.RetryDecorator behavior

2017-09-22 Thread Joshua Harlow

Hi Renat,

I was more just saying that depending on your situation it might be 
better to switch to using tenacity (not that the retry decorator is 
deprecated, though I wouldn't personally use it).


As you mentioned in 
https://bugs.launchpad.net/oslo.service/+bug/1718635/comments/1 this 
class and decorator is not thread safe so if that is a concern for you 
then that is also better in tenacity.


I think a lot of usage of that decorator though is like the following:

def main_func():

   @loopingcall.RetryDecorator
   def inner_func():
  

   
   inner_func()
   

So likely thread-safety was never a concern, though I can't quite say... 
I think (but I might be wrong) when that class/code was being proposed I 
recommended just using 'retrying' (the precursor to tenacity) but 
bygones be bygones...


Renat Akhmerov wrote:

Thanks Josh,

I’m not sure I fully understand your point though. You mean it’s a
legacy (deprecated?) code that we should never use in our code? Should
it be considered a private class of oslo_service?

In our global requirements tenacity is configured as "tenacity>=3.2.1”,
should we bump it to 4.4.0?

Renat Akhmerov
@Nokia

On 21 Sep 2017, 22:42 +0700, Joshua Harlow , wrote:

It does look like is sort of a bug,

Though in all honesty I wouldn't be using oslo.service or that looping
code in the future for doing retrying...

https://pypi.python.org/pypi/tenacity is a much better library with more
`natural` syntax and works more as one would expect (even under threaded
situations).

If I could of I would of never let 'loopingcall.py' become a file that
exists, but the past is the past, ha.

Renat Akhmerov wrote:

Hi Oslo team,

Can you please check the bug [1]?

There may be a problem with how looping.RetryDecorator works. Just
stumbled on it in Mistral. Not sure if it’s really a bug or made by
design. If it’s by design then maybe we need to have more accurate
documentation for it.

FYI: We use this decorator in Mistral and it’s also used in Nova, [2].

[1] https://bugs.launchpad.net/oslo.service/+bug/1718635
[2]
http://git.openstack.org/cgit/openstack/nova/tree/nova/virt/disk/mount/api.py

Thanks

Renat Akhmerov
@Nokia

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe:
openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [oslo][oslo.service] looping.RetryDecorator behavior

2017-09-21 Thread Renat Akhmerov
Thanks Josh,

I’m not sure I fully understand your point though. You mean it’s a legacy 
(deprecated?) code that we should never use in our code? Should it be 
considered a private class of oslo_service?

In our global requirements tenacity is configured as "tenacity>=3.2.1”, should 
we bump it to 4.4.0?

Renat Akhmerov
@Nokia

On 21 Sep 2017, 22:42 +0700, Joshua Harlow , wrote:
> It does look like is sort of a bug,
>
> Though in all honesty I wouldn't be using oslo.service or that looping
> code in the future for doing retrying...
>
> https://pypi.python.org/pypi/tenacity is a much better library with more
> `natural` syntax and works more as one would expect (even under threaded
> situations).
>
> If I could of I would of never let 'loopingcall.py' become a file that
> exists, but the past is the past, ha.
>
> Renat Akhmerov wrote:
> > Hi Oslo team,
> >
> > Can you please check the bug [1]?
> >
> > There may be a problem with how looping.RetryDecorator works. Just
> > stumbled on it in Mistral. Not sure if it’s really a bug or made by
> > design. If it’s by design then maybe we need to have more accurate
> > documentation for it.
> >
> > FYI: We use this decorator in Mistral and it’s also used in Nova, [2].
> >
> > [1] https://bugs.launchpad.net/oslo.service/+bug/1718635
> > [2]
> > http://git.openstack.org/cgit/openstack/nova/tree/nova/virt/disk/mount/api.py
> >
> > Thanks
> >
> > Renat Akhmerov
> > @Nokia
> >
> > __
> > OpenStack Development Mailing List (not for usage questions)
> > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [oslo][oslo.service] looping.RetryDecorator behavior

2017-09-21 Thread Joshua Harlow

It does look like is sort of a bug,

Though in all honesty I wouldn't be using oslo.service or that looping 
code in the future for doing retrying...


https://pypi.python.org/pypi/tenacity is a much better library with more 
`natural` syntax and works more as one would expect (even under threaded 
situations).


If I could of I would of never let 'loopingcall.py' become a file that 
exists, but the past is the past, ha.


Renat Akhmerov wrote:

Hi Oslo team,

Can you please check the bug [1]?

There may be a problem with how looping.RetryDecorator works. Just
stumbled on it in Mistral. Not sure if it’s really a bug or made by
design. If it’s by design then maybe we need to have more accurate
documentation for it.

FYI: We use this decorator in Mistral and it’s also used in Nova, [2].

[1] https://bugs.launchpad.net/oslo.service/+bug/1718635
[2]
http://git.openstack.org/cgit/openstack/nova/tree/nova/virt/disk/mount/api.py

Thanks

Renat Akhmerov
@Nokia

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [oslo][oslo.service] looping.RetryDecorator behavior

2017-09-21 Thread Renat Akhmerov
Hi Oslo team,

Can you please check the bug [1]?

There may be a problem with how looping.RetryDecorator works. Just stumbled on 
it in Mistral. Not sure if it’s really a bug or made by design. If it’s by 
design then maybe we need to have more accurate documentation for it.

FYI: We use this decorator in Mistral and it’s also used in Nova, [2].

[1]  https://bugs.launchpad.net/oslo.service/+bug/1718635
[2] 
http://git.openstack.org/cgit/openstack/nova/tree/nova/virt/disk/mount/api.py

Thanks

Renat Akhmerov
@Nokia
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev