SOLR-5577: fix possible race on canceling timer on close

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1555204 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2014-01-03 19:06:22 +00:00
parent 4612f80e8d
commit e8b46f76a7
1 changed files with 4 additions and 1 deletions

View File

@ -177,8 +177,11 @@ public class ConnectionManager implements Watcher {
public void close() {
this.isClosed = true;
this.likelyExpired = true;
if (this.disconnectedTimer != null) {
try {
this.disconnectedTimer.cancel();
} catch (NullPointerException e) {
// fine
} finally {
this.disconnectedTimer = null;
}
}