From fc55314d1c43041f958cc522c72de6da1d46de8e Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Sat, 7 Nov 2015 15:16:51 -0800 Subject: [PATCH] ForkingTaskRunner: Log without buffering. In #933 the ForkingTaskRunner's logging was changed to buffered from unbuffered. This means that the last few KB of the logs are generally not visible while a task is running, which makes debugging running tasks difficult. --- .../main/java/io/druid/indexing/overlord/ForkingTaskRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/ForkingTaskRunner.java b/indexing-service/src/main/java/io/druid/indexing/overlord/ForkingTaskRunner.java index 3cb40a14d28..84648c19c47 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/ForkingTaskRunner.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/ForkingTaskRunner.java @@ -260,7 +260,7 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer log.info("Logging task %s output to: %s", task.getId(), logFile); boolean runFailed = true; - try (final OutputStream toLogfile = Files.asByteSink(logFile).openBufferedStream()) { + try (final OutputStream toLogfile = Files.asByteSink(logFile).openStream()) { ByteStreams.copy(processHolder.process.getInputStream(), toLogfile); final int statusCode = processHolder.process.waitFor(); log.info("Process exited with status[%d] for task: %s", statusCode, task.getId());