mirror of https://github.com/apache/lucene.git
SOLR-863 -- SolrCore.initIndex should close the directory it gets for clearing the lock and use the DirectoryFactory
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@727719 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
39c1b9b3a5
commit
c2c78750e8
|
@ -182,6 +182,9 @@ Bug Fixes
|
|||
otherwise it writes fieldType.toObject. This fixes the bug with encoding/decoding UUIDField.
|
||||
(koji, Noble Paul, shalin)
|
||||
|
||||
18. SOLR-863: SolrCore.initIndex should close the directory it gets for clearing the lock and
|
||||
use the DirectoryFactory. (Mark Miller via shalin)
|
||||
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
|
|
@ -360,11 +360,14 @@ public final class SolrCore implements SolrInfoMBean {
|
|||
if (indexExists && firstTime && removeLocks) {
|
||||
// to remove locks, the directory must already exist... so we create it
|
||||
// if it didn't exist already...
|
||||
Directory dir = SolrIndexWriter.getDirectory(getIndexDir(), solrConfig.mainIndexConfig);
|
||||
if (dir != null && IndexWriter.isLocked(dir)) {
|
||||
Directory dir = SolrIndexWriter.getDirectory(getIndexDir(), getDirectoryFactory(), solrConfig.mainIndexConfig);
|
||||
if (dir != null) {
|
||||
if (IndexWriter.isLocked(dir)) {
|
||||
log.warn(logid+"WARNING: Solr index directory '" + getIndexDir() + "' is locked. Unlocking...");
|
||||
IndexWriter.unlock(dir);
|
||||
}
|
||||
dir.close();
|
||||
}
|
||||
}
|
||||
|
||||
// Create the index if it doesn't exist.
|
||||
|
|
Loading…
Reference in New Issue