zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gmail <chl.wan...@gmail.com>
Subject question about zk c client:about watcher
Date Thu, 09 Oct 2014 14:59:54 GMT
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message