incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Fixing bug with hdfs directory closing after path has been moved or removed.
Date Mon, 27 Apr 2015 12:09:52 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master be53426e4 -> 9623f67ac


Fixing bug with hdfs directory closing after path has been moved or removed.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/9623f67a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/9623f67a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/9623f67a

Branch: refs/heads/master
Commit: 9623f67ac1e3e94b330b9564070540ecc04c9d23
Parents: be53426
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Apr 27 08:09:39 2015 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Apr 27 08:09:39 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/blur/manager/writer/IndexImporterTest.java   | 2 +-
 .../src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java  | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/9623f67a/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
b/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
index b791c4a..68e0a3d 100644
--- a/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
+++ b/blur-core/src/test/java/org/apache/blur/manager/writer/IndexImporterTest.java
@@ -226,7 +226,6 @@ public class IndexImporterTest {
   public void tearDown() throws IOException {
     _timer.cancel();
     _timer.purge();
-    IOUtils.closeQuietly(_commitWriter);
     IOUtils.closeQuietly(_mainWriter);
     IOUtils.closeQuietly(_indexImporter);
     _base.getFileSystem(_configuration).delete(_base, true);
@@ -234,6 +233,7 @@ public class IndexImporterTest {
 
   @Test
   public void testIndexImporterWithBadIndex() throws IOException {
+    _commitWriter.close();
     _fileSystem.delete(_path, true);
     _fileSystem.mkdirs(_path);
     _indexImporter.run();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/9623f67a/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java
----------------------------------------------------------------------
diff --git a/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java b/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java
index 869f224..40931bc 100644
--- a/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java
+++ b/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java
@@ -622,12 +622,16 @@ public class HdfsDirectory extends Directory implements LastModified,
HdfsSymlin
           break;
         } catch (FileNotFoundException e) {
           // Wait and retry
+          if (retryCount >= 5) {
+            throw e;
+          }
           LOG.debug("File not found exception can occur while changes are being made to the
file system, retrying.", e);
           try {
             Thread.sleep(100 * (retryCount + 1));
           } catch (InterruptedException ex) {
             throw e;
           }
+          retryCount++;
         }
       }
       boolean exists;


Mime
View raw message