SOLR-5577: Don't start a timer on disconnect if we are already closed

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1553981 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-12-29 00:14:01 +00:00
parent bd2d84b7b9
commit 419d644f40
1 changed files with 12 additions and 11 deletions

View File

@ -82,18 +82,19 @@ public class ConnectionManager implements Watcher {
disconnectedTimer.cancel();
disconnectedTimer = null;
}
disconnectedTimer = new Timer();
disconnectedTimer.schedule(new TimerTask() {
@Override
public void run() {
synchronized (ConnectionManager.this) {
likelyExpired = true;
if (!isClosed) {
disconnectedTimer = new Timer();
disconnectedTimer.schedule(new TimerTask() {
@Override
public void run() {
synchronized (ConnectionManager.this) {
likelyExpired = true;
}
}
}
}, (long) (client.getZkClientTimeout() * 0.90));
}, (long) (client.getZkClientTimeout() * 0.90));
}
connected = false;
}