SOLR-3844: SolrCore reload can fail because it tries to remove the index write lock while already holding it.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1385135 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-09-15 17:37:15 +00:00
parent 922c7316d8
commit d8385729c2
2 changed files with 6 additions and 3 deletions

View File

@ -222,6 +222,9 @@ Bug Fixes
(maxOptimizeSegments, softCommit, expungeDeletes) when sending a commit to
replicas. (Andy Laird, Tomas Fernandez Lobbe, Mark Miller)
* SOLR-3844: SolrCore reload can fail because it tries to remove the index
write lock while already holding it. (Mark Miller)
Other Changes
----------------------

View File

@ -410,7 +410,7 @@ public final class SolrCore implements SolrInfoMBean {
// protect via synchronized(SolrCore.class)
private static Set<String> dirs = new HashSet<String>();
void initIndex() {
void initIndex(boolean reload) {
try {
String indexDir = getNewIndexDir();
boolean indexExists = getDirectoryFactory().exists(indexDir);
@ -422,7 +422,7 @@ public final class SolrCore implements SolrInfoMBean {
initIndexReaderFactory();
if (indexExists && firstTime) {
if (indexExists && firstTime && !reload) {
// to remove locks, the directory must already exist... so we create it
// if it didn't exist already...
Directory dir = directoryFactory.get(indexDir, getSolrConfig().indexConfig.lockType);
@ -644,7 +644,7 @@ public final class SolrCore implements SolrInfoMBean {
this.isReloaded = true;
}
initIndex();
initIndex(prev != null);
initWriters();
initQParsers();