You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ae...@apache.org on 2017/10/24 00:40:59 UTC
[07/50] hadoop git commit: YARN-7124. LogAggregationTFileController
deletes/renames while file is open. Contributed by Jason Lowe.
YARN-7124. LogAggregationTFileController deletes/renames while file is open. Contributed by Jason Lowe.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1fcbe7cf
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1fcbe7cf
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1fcbe7cf
Branch: refs/heads/HDFS-7240
Commit: 1fcbe7cf5f2f7c609cd4158912f151848268ca9e
Parents: a50be1b
Author: Junping Du <ju...@apache.org>
Authored: Mon Oct 16 13:57:03 2017 -0700
Committer: Junping Du <ju...@apache.org>
Committed: Mon Oct 16 13:57:03 2017 -0700
----------------------------------------------------------------------
.../filecontroller/tfile/LogAggregationTFileController.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/1fcbe7cf/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/tfile/LogAggregationTFileController.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/tfile/LogAggregationTFileController.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/tfile/LogAggregationTFileController.java
index 92e3a08..5064e26 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/tfile/LogAggregationTFileController.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/tfile/LogAggregationTFileController.java
@@ -96,8 +96,10 @@ public class LogAggregationTFileController
@Override
public void closeWriter() {
- this.writer.close();
- this.writer = null;
+ if (this.writer != null) {
+ this.writer.close();
+ this.writer = null;
+ }
}
@Override
@@ -117,6 +119,9 @@ public class LogAggregationTFileController
record.increcleanupOldLogTimes();
}
+ // close the writer before the file is renamed or deleted
+ closeWriter();
+
final Path renamedPath = record.getRollingMonitorInterval() <= 0
? record.getRemoteNodeLogFileForApp() : new Path(
record.getRemoteNodeLogFileForApp().getParent(),
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org