static void fsof_root_node_watcher()

in agent/src/c/src/fsof_main.c [352:365]


static void fsof_root_node_watcher(zhandle_t* zh, int type, int state,
                                            const char* path, void* watcherCtx) {
    if (type == ZOO_SESSION_EVENT) {
        if(state == ZOO_CONNECTED_STATE) {
            //begin get children from root node
            get_zk_root_children();
        } else if (state == ZOO_EXPIRED_SESSION_STATE  || state == ZOO_CONNECTING_STATE || state == ZOO_AUTH_FAILED_STATE) {
            //log info  sesstion expired need rejoin
            fsof_log_info(ERROR,"zookeeper session expired,need rejoin zookeeper\n");
            fsof_zk_close();
            init_zookeeper_env();
        }
    }
}