In the FAQ, there is a question 4. Is there an easy way to expire a session for testing?
And the last part of the answer reads: In the case of testing we want to cause a problem, so to explicitly expire a session an application connects to ZooKeeper, saves the session id and password, creates another ZooKeeper handle with that id and password, and then closes the new handle. Since both handles reference the same session, the close on second handle will invalidate the session causing a SESSION_EXPIRED on the first handle. (I assume when it says ³creates another ZooKeeper handle² I¹m assuming it means do that by calling init_zookeeper. Is that correct? Here¹s my skeleton code, which doesn¹t work. ... clientid_t myid; clientid_t another_id; zhandle_t zh_1; zhandle_t zh_2; zoo_deterministic_conn_order(1); zh_1 = zookeeper_init ( servers, watcher, 10000, &myid, 0, 0); if ( !zh_1 ) { ...error... } // Catch sigusr1 and set the havoc flag if ( cry_havoc_and_let_loose_the_dogs_of_war ) { memcpy ( &another_id, &myid, sizeof (clientid_t)); zh_2 = zookeeper_init ( servers, destroy_watcher, 10000, &another_id, 0, 0); if ( ! zh_2 ) { .... errror ... } if ( !nzh ) { ... error ... } zookeeper_close ( zh_2); // Shouldn't I get a session expire shortly after this? } But I don¹t get a session expire. Can someone tell me what I¹m doing wrong? TIA, Leonard Leonard Cuff lc...@valueclick.com ³This email and any files included with it may contain privileged, proprietary and/or confidential information that is for the sole use of the intended recipient(s). Any disclosure, copying, distribution, posting, or use of the information contained in or attached to this email is prohibited unless permitted by the sender. If you have received this email in error, please immediately notify the sender via return e-mail, telephone, or fax and destroy this original transmission and its included files without reading or saving it in any manner. Thank you.² This email and any files included with it may contain privileged, proprietary and/or confidential information that is for the sole use of the intended recipient(s). Any disclosure, copying, distribution, posting, or use of the information contained in or attached to this email is prohibited unless permitted by the sender. If you have received this email in error, please immediately notify the sender via return email, telephone, or fax and destroy this original transmission and its included files without reading or saving it in any manner. Thank you.