curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jordan Zimmerman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CURATOR-185) Create a LOST_SESSION connection state
Date Tue, 05 May 2015 20:17:01 GMT

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

Jordan Zimmerman commented on CURATOR-185:
------------------------------------------

I wonder if this shouldn't be a separate notification than connection state. Curator simulates
a never ending ZK connection by internally creating/closing/re-creating ZK instances. So,
Curator's connection state spans ZK connections and session doesn't really apply. You can
currently listen for session events via the normal ZK default watcher when you create your
Curator instance:

{code}
CuratorFrameworkFactory.builder()   ....
   .zookeeperFactory(custom-factory-that-sets-a-default-watcher)
{code}


> Create a LOST_SESSION connection state
> --------------------------------------
>
>                 Key: CURATOR-185
>                 URL: https://issues.apache.org/jira/browse/CURATOR-185
>             Project: Apache Curator
>          Issue Type: New Feature
>          Components: Client
>    Affects Versions: 2.7.1
>            Reporter: Benjamin Jaton
>
> Since the LOST connection state doesn't have anything to do with the loss of the ZK session,
it would be very useful to have an event for it.
> Suggested implementation to detect the loss of session:
> - Upon reception of the SUSPENDED state, start a timer
> - if we receive a RECONNECTED event, check the session ID. If we have a different session
ID, then our session has been lost
> - if we didn't receive a RECONNECTED event and the time reaches <sessionTimeoutMs>,
our session is lost
> That should inform the user of the loss of a session in a timely fashion.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message