I am using zookeeper 3.4.6:

ZK_INFO@_log_env@717: Client environment:zookeeper.version=zookeeper C client 
3.4.6
ZK_INFO@_log_env@728: Client environment:os.name=Linux
ZK_INFO@_log_env@729: Client environment:os.arch=2.6.32-573.3.1.el6.x86_64
ZK_INFO@_log_env@730: Client environment:os.version=#1 SMP Mon Aug 10 09:44:54 
EDT 2015

Invoking zoo_awget_children2() with a watcher function, context set to 
0x2b75d80019a0:

DSREG_DEBUG@dsreg/Recipe.cc_Context@193: context 0x2b75d80019a0
ZK_DEBUG@_zoo_awget_children2_@2941: Sending request xid=0x56d05cf5 for path 
[/this/is/a/test] to ...

The connection is through tcprelay, I take it down, and the watcher gets 
triggered:

ZK_ERROR@_handle_socket_error_msg@1742: Socket [...] zk retcode=-4, 
errno=112(Host is down): failed while receiving a server response
ZK_DEBUG@_handle_error@1234: Calling a watcher for a ZOO_SESSION_EVENT and the 
state=CONNECTING_STATE
ZK_DEBUG@_process_completions@2132: Calling a watcher for node [], type = -1 
event=ZOO_SESSION_EVENT
DSREG_DEBUG@zkcore/Session.cc_dsreg_invoke_recipe_watcher@681: context 
0x2b75d80019a0
DSREG_NEVER@zkcore/Session.cc_dsreg_invoke_recipe_watcher@696: Watcher 
triggered with ztype ZkSession(-1) zstate Connection to the server has been 
lost(1) for GlobTracker(0x
1575520)

At this point I delete context 0x2b75d80019a0, wait a bit, then restart 
tcprelay.  The session has expired, and the watcher triggers again with the 
already deleted context 0x2b75d80019a0:

ZK_INFO@_check_events@1724: initiated connection to server [...]
ZK_ERROR@_handle_socket_error_msg@1760: Socket [...] zk retcode=-112, 
errno=116(Stale file handle): sessionId=0x1531787c4f70042 has expired.
ZK_DEBUG@_handle_error@1231: Calling a watcher for a ZOO_SESSION_EVENT and the 
state=ZOO_EXPIRED_SESSION_STATE
ZK_DEBUG@_do_io@446: IO thread terminated
ZK_DEBUG@_process_completions@2132: Calling a watcher for node [], type = -1 
event=ZOO_SESSION_EVENT
DSREG_DEBUG@zkcore/Session.cc_dsreg_invoke_recipe_watcher@681: context 
0x2b75d80019a0

Is it a bug or feature that the same watcher context gets triggered multiple 
times?  If it's a feature, how can I tell when it's safe to delete the context?


Andras



--------------------------------------------------------------------------------

NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies; do not disclose, use or act 
upon the information; and notify the sender immediately. Mistransmission is not 
intended to waive confidentiality or privilege. Morgan Stanley reserves the 
right, to the extent permitted under applicable law, to monitor electronic 
communications. This message is subject to terms available at the following 
link: http://www.morganstanley.com/disclaimers. If you cannot access these 
links, please notify us by reply message and we will send the contents to you. 
By messaging with Morgan Stanley you consent to the foregoing.

Reply via email to