Hi all,
I am a newer for zookeeper, I use zk 3.4.5 in my program. when zk_watcher 
(initialed by zk_init function) is called when zk events present, the input 
paras of the function are invalid.
the type == -1, path = “”, state = 1 or 3

My src like this:
zhandle = zookeeper_init(hosts, zk_watcher, zk_timeout, NULL, NULL, 0);

static void zk_watcher(zhandle_t *zh, int type, int state, const char *path,
                       void *ctx)
{
...
        sd_debug("path:%s, type:%d, state:%d", path, type, state);
...
}

the output of the program :
Sep 27 14:40:08  DEBUG [main] zk_watcher(672) path:, type:-1, state:3
Sep 27 14:40:08  DEBUG [main] zk_watcher(672) path:, type:-1, state:1
Sep 27 14:40:08  DEBUG [main] zk_watcher(672) path:, type:-1, state:3
Sep 27 14:40:08  DEBUG [main] zk_watcher(672) path:, type:-1, state:1
Sep 27 14:40:18  DEBUG [main] zk_watcher(672) path:, type:-1, state:3
Sep 27 14:40:18  DEBUG [main] zk_watcher(672) path:, type:-1, state:1
Sep 27 14:40:18  DEBUG [main] zk_watcher(672) path:, type:-1, state:3
Sep 27 14:40:18  DEBUG [main] zk_watcher(672) path:, type:-1, state:1
Sep 27 14:40:19  DEBUG [main] zk_watcher(672) path:, type:-1, state:3
Sep 27 14:40:19  DEBUG [main] zk_watcher(672) path:, type:-1, state:1

I want to know why the input paras are invalid, what happened in this condition?
The connection between client and server is lost or expired? whether I  need 
reconnect?

thanks for your help, wait for your reply.

-- 
Gmail

Reply via email to