Github user kevinxu021 commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1427#discussion_r172737047
--- Diff: dcs/src/main/java/org/trafodion/dcs/zookeeper/ZkClient.java ---
@@ -176,7 +208,19 @@ public ZooKeeper getZk() {
public void process(WatchedEvent event) {
if(event.getState() == Watcher.Event.KeeperState.SyncConnected)
{
connectedSignal.countDown();
- }
+ } else if (event.getState() ==
Watcher.Event.KeeperState.Expired) {
+ LOG.info("session expired. now rebuilding");
+ // session expired, may be never happending. but if it happen
there
+ // need to close old client and rebuild new client
+ try {
+ connect(true);
+ } catch (IOException e) {
+ setSessionRecoverSuccessful(false);
+ LOG.error("session expired and throw IOException while do
reconnect: " + e.getMessage());
+ } catch (InterruptedException e) {
+ LOG.error("session expired and throw InterruptedException
while do reconnect: " + e.getMessage());
--- End diff --
The same as above.
---