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

how to close zk connection from a listener? #90

Open
OrangeJam-zon opened this issue Jul 31, 2023 · 1 comment
Open

how to close zk connection from a listener? #90

OrangeJam-zon opened this issue Jul 31, 2023 · 1 comment

Comments

@OrangeJam-zon
Copy link

image
image
As shown in the above figure, I tried to close the connection in the listener function when it is in a Disconnected state. However, calling the close() method throws an InterruptedException. The code that throws the exception is as follows.
image
When an exception is thrown, the function returns directly, preventing it from reaching the subsequent close method and causing it to fail to close. Additionally, it is not possible to catch this exception externally because the zkClient internally has a thread that catches the exception.
so, how can I do to close it in the listener function?
please, help me. thanks

@OrangeJam-zon
Copy link
Author

by the way, I just want to close the connection when the zk server cant access, to ensure normal business processing.

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

No branches or pull requests

1 participant