Skip to content

Instantly share code, notes, and snippets.

@Randgalt
Created March 31, 2020 23:26
Show Gist options
  • Save Randgalt/4e84f3f46fd19267f02f7fe57a06e51a to your computer and use it in GitHub Desktop.
Save Randgalt/4e84f3f46fd19267f02f7fe57a06e51a to your computer and use it in GitHub Desktop.
// change to checkSessionExpiration()
else if ( currentConnectionState == ConnectionState.LOST )
{
try
{
if ( client.getZookeeperClient().isConnected() )
{
log.warn("ConnectionState is LOST but isConnected() is true. Resetting connection.");
client.getZookeeperClient().reset();
}
else
{
// give ConnectionState.checkTimeouts() a chance to run, reset ensemble providers, etc.
client.getZookeeperClient().getZooKeeper();
}
}
catch ( Exception e )
{
log.error("Could not get ZooKeeper", e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment