FLUME-1513: File Channel log close() method should not be synchronized (Hari Shreedharan via Brock Noland)
Project: http://git-wip-us.apache.org/repos/asf/flume/repo Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/9ad93a92 Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/9ad93a92 Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/9ad93a92 Branch: refs/heads/cdh-1.2.0+24_intuit Commit: 9ad93a92db934be7cc4ef78aebd4bff510280853 Parents: ad3b5b9 Author: Brock Noland <[email protected]> Authored: Mon Aug 27 13:50:27 2012 -0500 Committer: Mike Percy <[email protected]> Committed: Fri Sep 7 14:03:06 2012 -0700 ---------------------------------------------------------------------- .../java/org/apache/flume/channel/file/Log.java | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flume/blob/9ad93a92/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java ---------------------------------------------------------------------- diff --git a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java index 5b39b57..b8f6570 100644 --- a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java +++ b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java @@ -493,10 +493,10 @@ class Log { } /** - * Synchronization required since we do not want this - * to be called during a checkpoint. + * Synchronization not required since this method gets the write lock, + * so checkpoint and this method cannot run at the same time. */ - synchronized void close() { + void close() { lockExclusive(); try { open = false;
