[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287086#comment-13287086
 ] 

Thawan Kooburat commented on ZOOKEEPER-1436:
--------------------------------------------

Yes, we use this as a notification only. We don't change any behavior of the 
client.

We mainly use this so that master can stop servicing request and let the slave 
take over. So this event give a sufficient information for us since we also set 
session timeout to be quite low (4 seconds). I agree that your solution will 
allow client to implement further optimization to retain the session. 
                
> Add ZOO_TIMED_OUT_STATE sesion event to notify client about timeout during 
> reconnection
> ---------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1436
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1436
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: c client
>    Affects Versions: 3.4.3
>            Reporter: Thawan Kooburat
>            Assignee: Thawan Kooburat
>              Labels: patch
>         Attachments: ZOOKEEPER-1436.patch, ZOOKEEPER-1436.patch
>
>
> The zookeeper c client knows how long its session will last, and periodically 
> pings in order to keep that session alive. However, if it loses connection, 
> it hops from ensemble member to ensemble member trying to reform the session 
> - even after the session timeout expires.
> This patch at a new session event (ZOO_TIMED_OUT_STATE) that notifies the 
> user that the session timeout has passed, and we have been unable to 
> reconnect. The event is one-shot per disconnection and get generated from the 
> C-client library itself. The server has no knowledge of this event.  
> Example use cases:
> 1. Client can try to reconnect to a different set of observers if it unable 
> to connect to the original set of observers.
> 2. Client can quickly stop acting as an active server, since other server may 
> already taken over the active role while it is trying to reconnect. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to