flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: FLUME-2328: FileChannel Dual Checkpoint Backup Thread not released on Application stop
Date Fri, 28 Feb 2014 23:10:59 GMT
Repository: flume
Updated Branches:
  refs/heads/trunk 1fbb7c929 -> c9b531e70


FLUME-2328: FileChannel Dual Checkpoint Backup Thread not released on Application stop

(Hari Shreedharan via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/c9b531e7
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/c9b531e7
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/c9b531e7

Branch: refs/heads/trunk
Commit: c9b531e70a655e331f18012d3c24614ac2c66b75
Parents: 1fbb7c9
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Fri Feb 28 15:09:11 2014 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Fri Feb 28 15:09:11 2014 -0800

----------------------------------------------------------------------
 .../flume/channel/file/EventQueueBackingStoreFile.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/c9b531e7/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/EventQueueBackingStoreFile.java
----------------------------------------------------------------------
diff --git a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/EventQueueBackingStoreFile.java
b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/EventQueueBackingStoreFile.java
index 8a9fdae..113dcd2 100644
--- a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/EventQueueBackingStoreFile.java
+++ b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/EventQueueBackingStoreFile.java
@@ -301,6 +301,18 @@ abstract class EventQueueBackingStoreFile extends EventQueueBackingStore
{
     } catch (IOException e) {
       LOG.info("Error closing " + checkpointFile, e);
     }
+    if(checkpointBackUpExecutor != null && !checkpointBackUpExecutor
+      .isShutdown()) {
+      checkpointBackUpExecutor.shutdown();
+      try {
+        // Wait till the executor dies.
+        while (!checkpointBackUpExecutor.awaitTermination(1,
+          TimeUnit.SECONDS));
+      } catch (InterruptedException ex) {
+        LOG.warn("Interrupted while waiting for checkpoint backup to " +
+          "complete");
+      }
+    }
   }
 
   @Override


Mime
View raw message