mirror of https://github.com/apache/druid.git
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:
parent
61139b9dfa
commit
fc55314d1c
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue