You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Zili Chen <wa...@gmail.com> on 2019/09/19 14:33:04 UTC

Enable configuration to replace usage of RetryLoop with SessionFailRetryLoop

Hi Curators,

I notice we have a SessionFailRetryLoop which fails all operations if
session expired. Is it possible we have an option to use
SessionFailRetryLoop for all internal retry-able operations?

Best,
tison.

Re: Enable configuration to replace usage of RetryLoop with SessionFailRetryLoop

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
Yes, this should be able to be accomplished via a custom ConnectionHandlingPolicy as I mentioned in my previous email. 

BTW - if you can't get the behavior you need I'm sure the committers would be open to any changes needed to make it work as you need it to.

-Jordan

> On Sep 19, 2019, at 9:55 AM, Zili Chen <wa...@gmail.com> wrote:
> 
> Additionally, is there a way we JUST fail on session expired? It is on
> the contrast of currently retry logic. I'd like to regard session expired
> as fatal error sometimes and hope Curator doesn't perform any other retries.
> 
> It will be helpful in situations mentioned in the javadoc of SessionFailRetryLoop.
> 
> Best,
> tison.
> 
> 
> Zili Chen <wander4096@gmail.com <ma...@gmail.com>> 于2019年9月19日周四 下午10:33写道:
> Hi Curators,
> 
> I notice we have a SessionFailRetryLoop which fails all operations if
> session expired. Is it possible we have an option to use
> SessionFailRetryLoop for all internal retry-able operations?
> 
> Best,
> tison.


Re: Enable configuration to replace usage of RetryLoop with SessionFailRetryLoop

Posted by Zili Chen <wa...@gmail.com>.
Additionally, is there a way we JUST fail on session expired? It is on
the contrast of currently retry logic. I'd like to regard session expired
as fatal error sometimes and hope Curator doesn't perform any other retries.

It will be helpful in situations mentioned in the javadoc of
SessionFailRetryLoop.

Best,
tison.


Zili Chen <wa...@gmail.com> 于2019年9月19日周四 下午10:33写道:

> Hi Curators,
>
> I notice we have a SessionFailRetryLoop which fails all operations if
> session expired. Is it possible we have an option to use
> SessionFailRetryLoop for all internal retry-able operations?
>
> Best,
> tison.
>

Re: Enable configuration to replace usage of RetryLoop with SessionFailRetryLoop

Posted by Zili Chen <wa...@gmail.com>.
Hi Jordan,

Thanks for your information! It really helps. I will give it a try.

Best,
tison.


Jordan Zimmerman <jo...@jordanzimmerman.com> 于2019年9月20日周五 下午10:00写道:

> Yes, I think so. It's been a very long time since I've looked
> at SessionFailRetryLoop and it was written by someone other than me. But,
> the general answer is this:
>
> The ConnectionHandlingPolicy controls how the retry loop handling is done.
> See, StandardConnectionHandlingPolicy.java. You can set a different
> ConnectionHandlingPolicy in the CuratorFrameworkFactory when creating the
> Curator instance. Write a custom handling policy that
> implements callWithRetry() however you need to.
>
> -Jordan
>
> On Sep 19, 2019, at 9:33 AM, Zili Chen <wa...@gmail.com> wrote:
>
> Hi Curators,
>
> I notice we have a SessionFailRetryLoop which fails all operations if
> session expired. Is it possible we have an option to use
> SessionFailRetryLoop for all internal retry-able operations?
>
> Best,
> tison.
>
>
>

Re: Enable configuration to replace usage of RetryLoop with SessionFailRetryLoop

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
Yes, I think so. It's been a very long time since I've looked at SessionFailRetryLoop and it was written by someone other than me. But, the general answer is this: 

The ConnectionHandlingPolicy controls how the retry loop handling is done. See, StandardConnectionHandlingPolicy.java. You can set a different ConnectionHandlingPolicy in the CuratorFrameworkFactory when creating the Curator instance. Write a custom handling policy that implements callWithRetry() however you need to.

-Jordan

> On Sep 19, 2019, at 9:33 AM, Zili Chen <wa...@gmail.com> wrote:
> 
> Hi Curators,
> 
> I notice we have a SessionFailRetryLoop which fails all operations if
> session expired. Is it possible we have an option to use
> SessionFailRetryLoop for all internal retry-able operations?
> 
> Best,
> tison.