lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1720775 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/store/hdfs/HdfsLockFactory.java
Date Fri, 18 Dec 2015 12:46:59 GMT
Author: markrmiller
Date: Fri Dec 18 12:46:59 2015
New Revision: 1720775

URL: http://svn.apache.org/viewvc?rev=1720775&view=rev
Log:
SOLR-8015: HdfsLock may fail to close a FileSystem instance if it cannot immediately obtain
an index lock.

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsLockFactory.java

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1720775&r1=1720774&r2=1720775&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Fri Dec 18 12:46:59 2015
@@ -68,6 +68,8 @@ Bug Fixes
 * SOLR-8419: TermVectorComponent for distributed search when distrib.singlePass could include
term
   vectors for documents that matched the query yet weren't in the returned documents. (David
Smiley)
 
+* SOLR-8015: HdfsLock may fail to close a FileSystem instance if it cannot immediately
+  obtain an index lock. (Mark Miller)
 
 Other Changes
 ----------------------

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsLockFactory.java?rev=1720775&r1=1720774&r2=1720775&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsLockFactory.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsLockFactory.java
Fri Dec 18 12:46:59 2015
@@ -89,17 +89,17 @@ public class HdfsLockFactory extends Loc
       }
     }
 
-    return new HdfsLock(fs, lockFile);
+    return new HdfsLock(conf, lockFile);
   }
   
   private static final class HdfsLock extends Lock {
-    
-    private final FileSystem fs;
+
+    private final Configuration conf;
     private final Path lockFile;
     private volatile boolean closed;
     
-    HdfsLock(FileSystem fs, Path lockFile) {
-      this.fs = fs;
+    HdfsLock(Configuration conf, Path lockFile) {
+      this.conf = conf;
       this.lockFile = lockFile;
     }
     
@@ -108,6 +108,7 @@ public class HdfsLockFactory extends Loc
       if (closed) {
         return;
       }
+      final FileSystem fs = FileSystem.get(lockFile.toUri(), conf);
       try {
         if (fs.exists(lockFile) && !fs.delete(lockFile, false)) {
           throw new LockReleaseFailedException("failed to delete: " + lockFile);



Mime
View raw message