aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2018-06-15 04:32:18 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-15 04:33:12 -0700
commitf5be981a28fa50ba83391d4cd42a6e8bce07cca0 (patch)
tree10170dc6dc81efd817cd955ae8546bdd2b6dea0f /src/main/java/com/google/devtools/build/lib/runtime
parent940fbd7aafc8227a5ff110ddac1be71d17225adf (diff)
Remove the removeHandler/releaseHandler pairs
They weren't actually doing anything. With default flags, createHandler never returns a FancyTerminalEventHandler, because that always gets wrapped in a RateLimitingEventHandler. Even so, under normal circumstances, the fancy terminal event handler always leaves the terminal in a valid state at the end of each printed line. We can only end up in a bad state if the blaze server is killed, but even then, this code wasn't doing anything because it didn't get to run. The only way to guarantee that the terminal is always in a valid state is to make sure that every stdout/stderr buffer we send to the client ends with a reset code sequence. The experimental ui handler is better at sending only complete buffers (we were previously using an auto-line flushing output stream, which didn't allow the event handler to reason about how much stuff got actually printed in a single write call). Anyway, I think we're in a better place now, and this code wasn't run, and if we want to fix it properly (if the switch to experimental_ui isn't sufficient), then we need to fix it elsewhere. PiperOrigin-RevId: 200699609
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
index 310829f65a..dae2f597f8 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
@@ -488,12 +488,6 @@ public class BlazeCommandDispatcher {
System.setOut(savedOut);
System.setErr(savedErr);
- reporter.removeHandler(handler);
- releaseHandler(handler);
- if (!eventHandlerOptions.useColor()) {
- reporter.removeHandler(ansiAllowingHandler);
- releaseHandler(ansiAllowingHandler);
- }
env.getTimestampGranularityMonitor().waitForTimestampGranularity(outErr);
}
}
@@ -602,15 +596,6 @@ public class BlazeCommandDispatcher {
return RateLimitingEventHandler.create(eventHandler, eventOptions.showProgressRateLimit);
}
- /** Unsets the event handler. */
- private void releaseHandler(EventHandler eventHandler) {
- if (eventHandler instanceof FancyTerminalEventHandler) {
- // Make sure that the terminal state of the old event handler is clear
- // before creating a new one.
- ((FancyTerminalEventHandler) eventHandler).resetTerminal();
- }
- }
-
/**
* Returns the runtime instance shared by the commands that this dispatcher
* dispatches to.