Repository: flume Updated Branches: refs/heads/flume-1.5 bff74a347 -> 6d3d0cd8e
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/6d3d0cd8 Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/6d3d0cd8 Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/6d3d0cd8 Branch: refs/heads/flume-1.5 Commit: 6d3d0cd8e23026a63b6ce05f14ae92a251654903 Parents: bff74a3 Author: Jarek Jarcec Cecho <[email protected]> Authored: Fri Feb 28 15:09:11 2014 -0800 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Fri Feb 28 15:10:06 2014 -0800 ---------------------------------------------------------------------- .../flume/channel/file/EventQueueBackingStoreFile.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flume/blob/6d3d0cd8/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
