Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zookeeper session lost, state: CLOSED - terminology #562

Closed
dabcoder opened this issue May 22, 2019 · 4 comments
Closed

Zookeeper session lost, state: CLOSED - terminology #562

dabcoder opened this issue May 22, 2019 · 4 comments
Labels

Comments

@dabcoder
Copy link
Contributor

I've got an question (more than an issue), apologies if it has already been raised but I do not believe it's the case.

I am seeing this in my logs:

Zookeeper connection established, state: CONNECTED
Zookeeper session lost, state: CLOSED

self.logger.info("Zookeeper session lost, state: %s", state)

And there's absolutely no issue whatsoever but I find the terminology a bit puzzling. As in the state is closed and by "session lost" I understand it as "the session has ended". So:

  1. Can anyone confirm that my understanding is correct - that it is not an actual problem
  2. Why is the CLOSED state in the same tuple as the other values AUTH_FAILED and EXPIRED_SESSION:

    kazoo/kazoo/client.py

    Lines 71 to 72 in 88b657a

    LOST_STATES = (KeeperState.EXPIRED_SESSION, KeeperState.AUTH_FAILED,
    KeeperState.CLOSED)
    if closed is a "normal" behavior?
@dabcoder
Copy link
Contributor Author

Any feedback on the above @StephenSorriaux? My understanding may not be correct, so would be interested in hearing other people thoughts on the topic. Thanks!

@StephenSorriaux
Copy link
Member

StephenSorriaux commented Sep 29, 2019

Hello,

  1. Your understanding is correct, this is a normal behavior. lost might not be the best wording though.

  2. LOST_STATES are states that mean that not connection is available and that a (re-)connection is required to communicate with the server

You can find more information about states in the official Zookeeper documentation.

@dabcoder
Copy link
Contributor Author

dabcoder commented Oct 1, 2019

Thanks. For 1. I indeed think that we could use closed instead of lost in the wording.
For 2., (thanks for pointing me to the docs), If an unrecoverable error occurs, such as session expiration or authentication failure, or if the application explicitly closes the handle, the handle will move to the CLOSED state, so we could also update the LOST_STATES tuple to CLOSED_STATES instead?

CLOSED_STATES = (KeeperState.EXPIRED_SESSION, KeeperState.AUTH_FAILED,
               KeeperState.CLOSED)

@StephenSorriaux
Copy link
Member

I agree, this would make more sense and follow the official documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants