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.
This commit is contained in:
Gian Merlino 2015-11-07 15:16:51 -08:00
parent 61139b9dfa
commit fc55314d1c
1 changed files with 1 additions and 1 deletions

View File

@ -260,7 +260,7 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer
log.info("Logging task %s output to: %s", task.getId(), logFile); log.info("Logging task %s output to: %s", task.getId(), logFile);
boolean runFailed = true; 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); ByteStreams.copy(processHolder.process.getInputStream(), toLogfile);
final int statusCode = processHolder.process.waitFor(); final int statusCode = processHolder.process.waitFor();
log.info("Process exited with status[%d] for task: %s", statusCode, task.getId()); log.info("Process exited with status[%d] for task: %s", statusCode, task.getId());