Skip to content

Commit

Permalink
Do not use a separate thread to check overseer leadership. We want to…
Browse files Browse the repository at this point in the history
… be interrupted
  • Loading branch information
HoustonPutman committed Oct 23, 2024
1 parent 99e17e3 commit 44199a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/cloud/Overseer.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public void run() {
log.info("Overseer Loop exiting : {}", LeaderElector.getNodeName(myId));
}
// do this in a separate thread because any wait is interrupted in this main thread
new Thread(this::checkIfIamStillLeader, "OverseerExitThread").start();
checkIfIamStillLeader();
}
}

Expand Down
4 changes: 3 additions & 1 deletion solr/core/src/java/org/apache/solr/cloud/ZkController.java
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,9 @@ public void preClose() {
this.isClosed = true;

try {
this.removeEphemeralLiveNode();
if (getZkClient().isConnected()) {
this.removeEphemeralLiveNode();
}
} catch (IllegalStateException
| SessionExpiredException
| KeeperException.ConnectionLossException e) {
Expand Down

0 comments on commit 44199a9

Please sign in to comment.