CURATOR-561 Reset connection after repeat expiry 399/head 400/head
authorScott Kirkpatrick <scott.kirkpatrick@appian.com>
Wed, 3 Nov 2021 16:53:48 +0000 (12:53 -0400)
committerScott Kirkpatrick <scott.kirkpatrick@appian.com>
Wed, 3 Nov 2021 17:12:53 +0000 (13:12 -0400)
commite2d32bd00ec05a18bf149a47865fd807e00a60e1
tree94562bbb2b97e8db4e8477751c6bcf42ca39d8db
parent1038aa6d03f240fb8a8de9736adc51ccbcc9f5b6
CURATOR-561 Reset connection after repeat expiry

If there is a problem posting the Expired KeeperState
during a session expiration, then the ZooKeeper event
thread will die without ever posting the Expired event.
This would then cause curator to keep trying to expire
the connection but it does nothing because the connection
is dead and no events will ever be posted.

This can be prevented by forcibly resetting the connection
if it's detected that the previous expiry had no effect
curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java
curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java