Github user skamille commented on the issue:
https://github.com/apache/zookeeper/pull/191
> ConnectionLossException can happen after a connection between ZooKeeper
client and server has been established, right? So having the check only in
watcher is not enough. A pass in watcher does not guarantee
ConnectionLossException will not occur in a later point in time. Imagine an
extreme case where the a network partition happened between client / server
after a session establishment - the client will first get a connected event,
and watcher happily reports everything is fine, then subsequent operation (e.g.
create) will fail with ConnectionLossException until the network healed.
Right but we're talking about a test case. If we have the issue that our
tests can connect to ZK, then randomly drop connections while in the midst of
the testing, that feels like a problem we should figure out. It should not
happen, and we rely on this particular "watch till connection then proceed with
test" functionality in tests throughout the code base. The fact that it is only
failing here seems to me a stranger problem. I'm supportive of adding more
logging to see if we can debug it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---