SOLR-6793: ReplicationHandler does not destroy all of it's created SnapPullers.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1650764 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2015-01-10 16:12:39 +00:00
parent 969dcdb43c
commit 8213fe8a0a
2 changed files with 12 additions and 1 deletions

View File

@ -415,6 +415,9 @@ Bug Fixes
* SOLR-6839: Direct routing with CloudSolrServer will ignore the Overwrite document option.
(Mark Miller)
* SOLR-6793: ReplicationHandler does not destroy all of it's created SnapPullers.
(Mark Miller)
Optimizations
----------------------

View File

@ -329,11 +329,16 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
if (!snapPullLock.tryLock())
return false;
try {
tempSnapPuller = snapPuller;
if (masterUrl != null) {
if (tempSnapPuller != null && tempSnapPuller != snapPuller) {
tempSnapPuller.destroy();
}
NamedList<Object> nl = solrParams.toNamedList();
nl.remove(SnapPuller.POLL_INTERVAL);
tempSnapPuller = new SnapPuller(nl, this, core);
} else {
tempSnapPuller = snapPuller;
}
return tempSnapPuller.fetchLatestIndex(core, forceReplication);
} catch (Exception e) {
@ -1001,6 +1006,9 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
if (snapPuller != null) {
snapPuller.destroy();
}
if (tempSnapPuller != null && tempSnapPuller != snapPuller) {
tempSnapPuller.destroy();
}
}
@Override