Skip to content
Permalink
Browse files
CURATOR-525 - instead of resetting the connection, change the state t…
…o RECONNECTED. I'm concerned about LOST/reset loops. This is still a bad hack and needs to be addressed in the future.
  • Loading branch information
randgalt authored and Randgalt committed Apr 11, 2020
1 parent a3ca8b5 commit 003f6f0082163889d9a1d423ad62095cc41a1366
Showing 1 changed file with 3 additions and 10 deletions.
@@ -291,16 +291,9 @@ else if ( sessionExpirationPercent > 0 )
if ( (currentConnectionState == ConnectionState.LOST) && client.getZookeeperClient().isConnected() )
{
// 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");
}
// this "hack" fixes it by forcing the state to RECONNECTED
log.warn("ConnectionState is LOST but isConnected() is true. Forcing RECONNECTED.");
addStateChange(ConnectionState.RECONNECTED);
}
}
}

0 comments on commit 003f6f0

Please sign in to comment.