[
https://issues.apache.org/jira/browse/ZOOKEEPER-1310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160637#comment-13160637
]
Marshall McMullen commented on ZOOKEEPER-1310:
----------------------------------------------
Maybe I've got the semantics wrong, but I had thought it's not the watch that
gets called, but the session event handler. e.g. when you call zookeeper_init
you give it a function and context to be called for session state changes. I
believe that should get called with CONNECTING state when the client
disconnects to reconnect to a new server.
The other part of this is the C API does some implicit session expiration stuff
for you under the hood. When half the session timeout goes by without getting a
response from the server it's connected to, it prematurely disconnects from
that server and tries to connect to a new one.
On the other hand, I do recall reading somewhere that it's a known limitation
of ZK that you don't get notified of a session loss until the client gets
reconnected to the ensemble.... Maybe others can chime in with clarification
and give us more specifics.
> C Api should use state CONNECTION_LOSS
> --------------------------------------
>
> Key: ZOOKEEPER-1310
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1310
> Project: ZooKeeper
> Issue Type: New Feature
> Components: c client
> Environment: Linux
> Reporter: Jakub Lekstan
>
> I would like to ZooKeeper let know my watcher (which I'm giving to
> zookeeeper_init) about CONNECTION_LOSS, right the given watcher doesn't know
> that connection is lost due to what I can't do my stuff.
> What you think? If so I could try to create a patch.
--
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