This is an automated email from the ASF dual-hosted git repository. randgalt pushed a commit to branch CURATOR-525-fix-lost-state-race in repository https://gitbox.apache.org/repos/asf/curator.git
commit ebdbd21e949e544e2f1cb8150d1a238837bac873 Author: randgalt <[email protected]> AuthorDate: Thu Apr 2 08:16:41 2020 -0500 CURATOR-525 - instead of resetting the connection, change the state to RECONNECTED. I'm concerned about LOST/reset loops. This is still a bad hack and needs to be addressed in the future. --- .../curator/framework/state/ConnectionStateManager.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java index 32ddb78..ecf9636 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java @@ -292,15 +292,8 @@ public class ConnectionStateManager implements Closeable { // CURATOR-525 - there is a race whereby LOST is sometimes set after the connection has been repaired // this "hack" fixes it by resetting the connection - log.warn("ConnectionState is LOST but isConnected() is true. Resetting connection."); - try - { - client.getZookeeperClient().reset(); - } - catch ( Exception e ) - { - log.error("Could not reset connection after LOST/isConnected mismatch"); - } + log.warn("ConnectionState is LOST but isConnected() is true. Forcing RECONNECTED."); + addStateChange(ConnectionState.RECONNECTED); } } }
