[sheepdog] [PATCH v4 5/5] zookeeper: handle session timeout for all zookeeper operations
Liu Yuan
namei.unix at gmail.com
Tue Jun 18 09:43:36 CEST 2013
On 06/18/2013 02:15 PM, Kai Zhang wrote:
>
> if (zoo_state(zhandle) == ZOO_EXPIRED_SESSION_STATE) {
> - sd_eprintf("detect a session timeout. reconnecting...");
> + sd_eprintf("detect a session timeout.");
> + while (uatomic_read(&zk_flying_ops) != 0) {
> + sd_eprintf("waiting for flying zookeeper operations"
> + " %" PRIu64,
> + zk_flying_ops);
> + sleep(1);
> + }
I am wondering why this is necessary. All the handlers are called in the
main thread include handling of reconnect. So basically, whenever you
reach here, zk_flying_ops will be 0, no?
Based on my understanding, this patch is completely unnecessary.
Thanks,
Yuan
More information about the sheepdog
mailing list