SOLR-13386: OverseerTaskQueue#remove should not throw an exception when no node exists after an exists check and the Overseer work loop should not allow free spinning the loop when it hits a KeeperException.

This commit is contained in:
markrmiller 2019-04-15 12:53:03 -05:00
parent d90034f0d6
commit ecbf7daf56
3 changed files with 17 additions and 2 deletions

View File

@ -193,6 +193,10 @@ Bug Fixes
* SOLR-13336: add maxBooleanClauses (default to 1024) setting to solr.xml, reverting previous effective
value of Integer.MAX_VALUE-1, to restrict risk of pathalogical query expansion. (hossman)
* SOLR-13386: OverseerTaskQueue#remove should not throw an exception when no node exists after an exists
check and the Overseer work loop should not allow free spinning the loop when it hits a KeeperException.
(Mark Miller, Fernandez-Lobbe, Mike Drob)
Improvements
----------------------

View File

@ -321,6 +321,15 @@ public class OverseerTaskProcessor implements Runnable, Closeable {
return;
}
SolrException.log(log, "", e);
// Prevent free-spinning this loop.
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
Thread.currentThread().interrupt();
return;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return;

View File

@ -93,9 +93,11 @@ public class OverseerTaskQueue extends ZkDistributedQueue {
String path = event.getId();
String responsePath = dir + "/" + RESPONSE_PREFIX
+ path.substring(path.lastIndexOf("-") + 1);
if (zookeeper.exists(responsePath, true)) {
try {
zookeeper.setData(responsePath, event.getBytes(), true);
} else {
} catch (KeeperException.NoNodeException ignored) {
// we must handle the race case where the node no longer exists
log.info("Response ZK path: " + responsePath + " doesn't exist."
+ " Requestor may have disconnected from ZooKeeper");
}