mirror of https://github.com/apache/lucene.git
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:
parent
bd2d84b7b9
commit
419d644f40
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue