SOLR-5834: Overseer threads are only being interrupted and not closed.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1575476 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2014-03-08 04:38:20 +00:00
parent 9900e7c44d
commit b97e7b5a4a
2 changed files with 14 additions and 10 deletions

View File

@ -138,6 +138,9 @@ Bug Fixes
* SOLR-5818: distrib search with custom comparator does not quite work correctly * SOLR-5818: distrib search with custom comparator does not quite work correctly
(Ryan Ernst) (Ryan Ernst)
* SOLR-5834: Overseer threads are only being interrupted and not closed.
(hossman, Mark Miller)
Optimizations Optimizations
---------------------- ----------------------
* SOLR-1880: Distributed Search skips GET_FIELDS stage if EXECUTE_QUERY * SOLR-1880: Distributed Search skips GET_FIELDS stage if EXECUTE_QUERY

View File

@ -81,8 +81,8 @@ public class Overseer {
//Internal queue where overseer stores events that have not yet been published into cloudstate //Internal queue where overseer stores events that have not yet been published into cloudstate
//If Overseer dies while extracting the main queue a new overseer will start from this queue //If Overseer dies while extracting the main queue a new overseer will start from this queue
private final DistributedQueue workQueue; private final DistributedQueue workQueue;
private volatile boolean isClosed;
private Map clusterProps; private Map clusterProps;
private boolean isClosed = false;
public ClusterStateUpdater(final ZkStateReader reader, final String myId) { public ClusterStateUpdater(final ZkStateReader reader, final String myId) {
this.zkClient = reader.getZkClient(); this.zkClient = reader.getZkClient();
@ -1030,20 +1030,22 @@ public class Overseer {
class OverseerThread extends Thread implements ClosableThread { class OverseerThread extends Thread implements ClosableThread {
private volatile boolean isClosed; protected volatile boolean isClosed;
private ClosableThread thread;
public OverseerThread(ThreadGroup tg, public OverseerThread(ThreadGroup tg, ClosableThread thread) {
ClusterStateUpdater clusterStateUpdater) { super(tg, (Runnable) thread);
super(tg, clusterStateUpdater); this.thread = thread;
} }
public OverseerThread(ThreadGroup ccTg, public OverseerThread(ThreadGroup ccTg, ClosableThread thread, String name) {
OverseerCollectionProcessor overseerCollectionProcessor, String string) { super(ccTg, (Runnable) thread, name);
super(ccTg, overseerCollectionProcessor, string); this.thread = thread;
} }
@Override @Override
public void close() { public void close() {
thread.close();
this.isClosed = true; this.isClosed = true;
} }
@ -1084,8 +1086,7 @@ public class Overseer {
ThreadGroup ccTg = new ThreadGroup("Overseer collection creation process."); ThreadGroup ccTg = new ThreadGroup("Overseer collection creation process.");
ocp = new OverseerCollectionProcessor(reader, id, shardHandler, adminPath); ocp = new OverseerCollectionProcessor(reader, id, shardHandler, adminPath);
ccThread = new OverseerThread(ccTg, ocp, ccThread = new OverseerThread(ccTg, ocp, "Overseer-" + id);
"Overseer-" + id);
ccThread.setDaemon(true); ccThread.setDaemon(true);
updaterThread.start(); updaterThread.start();