From f21641f0dc2b91cb64c9af32803bd0bbc6848970 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Wed, 22 Feb 2017 15:02:53 -0800 Subject: [PATCH] Fix over-optimistic log message. (#3963) "Wrote task log" could be logged before the output stream is flushed and closed, which could generate an error and not actually write the log. --- .../main/java/io/druid/storage/hdfs/tasklog/HdfsTaskLogs.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions-core/hdfs-storage/src/main/java/io/druid/storage/hdfs/tasklog/HdfsTaskLogs.java b/extensions-core/hdfs-storage/src/main/java/io/druid/storage/hdfs/tasklog/HdfsTaskLogs.java index f438b664367..e539aaba994 100644 --- a/extensions-core/hdfs-storage/src/main/java/io/druid/storage/hdfs/tasklog/HdfsTaskLogs.java +++ b/extensions-core/hdfs-storage/src/main/java/io/druid/storage/hdfs/tasklog/HdfsTaskLogs.java @@ -66,8 +66,9 @@ public class HdfsTaskLogs implements TaskLogs final OutputStream out = fs.create(path, true) ) { ByteStreams.copy(in, out); - log.info("Wrote task log to: %s", path); } + + log.info("Wrote task log to: %s", path); } @Override