You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flume.apache.org by ja...@apache.org on 2014/03/01 00:10:59 UTC

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

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 <ja...@apache.org>
Authored: Fri Feb 28 15:09:11 2014 -0800
Committer: Jarek Jarcec Cecho <ja...@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