aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/server')
-rw-r--r--src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
index 032da198d3..6abef0e4ac 100644
--- a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
+++ b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
@@ -860,12 +860,17 @@ public class GrpcServerImpl implements RPCServer {
// the cancel request won't find the thread to interrupt)
Thread.interrupted();
+ boolean shutdown = commandExecutor.shutdown();
+ if (shutdown) {
+ server.shutdown();
+ }
RunResponse response =
RunResponse.newBuilder()
.setCookie(responseCookie)
.setCommandId(commandId)
.setFinished(true)
.setExitCode(exitCode)
+ .setTerminationExpected(shutdown)
.build();
try {
@@ -876,11 +881,6 @@ public class GrpcServerImpl implements RPCServer {
log.info(String.format("Client cancelled command %s just right before its end: %s",
commandId, e.getMessage()));
}
-
- if (commandExecutor.shutdown()) {
- pidFileWatcherThread.signalShutdown();
- server.shutdown();
- }
}
private final CommandServerGrpc.CommandServerImplBase commandServer =