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.cancel();
disconnectedTimer = null; disconnectedTimer = null;
} }
if (!isClosed) {
disconnectedTimer = new Timer(); disconnectedTimer = new Timer();
disconnectedTimer.schedule(new TimerTask() { disconnectedTimer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
synchronized (ConnectionManager.this) { synchronized (ConnectionManager.this) {
likelyExpired = true; likelyExpired = true;
}
} }
}
}, (long) (client.getZkClientTimeout() * 0.90));
}, (long) (client.getZkClientTimeout() * 0.90)); }
connected = false; connected = false;
} }