zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zili Chen <wander4...@gmail.com>
Subject how session expire works in zookeeper codebase?
Date Tue, 24 Sep 2019 11:53:27 GMT
Hi ZooKeepers,

I want to trace where Watcher.Event.KeeperState.Expired generated and it
seems only generated
when connect to server fails due to exceed session timeout.

Besides, I find code snippet in ClientCnxn as below

void queueEvent(String clientPath, int err, Set<Watcher>
materializedWatchers, EventType eventType) {
        KeeperState sessionState = KeeperState.SyncConnected;
        if (KeeperException.Code.SESSIONEXPIRED.intValue() == err
            || KeeperException.Code.CONNECTIONLOSS.intValue() == err) {
            sessionState = Event.KeeperState.Disconnected;
        WatchedEvent event = new WatchedEvent(eventType, sessionState,
        eventThread.queueEvent(event, materializedWatchers);

which seems a bit wried to me what we queue
a Event.KeeperState.Disconnected on

Back to the question, how zookeeper discovers and triggers session expire
event on
session expired after connection established successfully?


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