diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/cpp/blaze.cc | 2 | ||||
-rw-r--r-- | src/main/cpp/blaze_util_linux.cc | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc index 7fb3511a0a..74ac64fe86 100644 --- a/src/main/cpp/blaze.cc +++ b/src/main/cpp/blaze.cc @@ -1941,7 +1941,7 @@ bool GrpcBlazeServer::Connect() { grpc::ClientContext context; context.set_deadline( - std::chrono::system_clock::now() + std::chrono::seconds(5)); + std::chrono::system_clock::now() + std::chrono::seconds(10)); command_server::PingRequest request; command_server::PingResponse response; diff --git a/src/main/cpp/blaze_util_linux.cc b/src/main/cpp/blaze_util_linux.cc index 27ab344159..82142d5b06 100644 --- a/src/main/cpp/blaze_util_linux.cc +++ b/src/main/cpp/blaze_util_linux.cc @@ -250,7 +250,18 @@ bool KillServerProcess( return false; } + // Kill the process and make sure it's dead before proceeding. killpg(pid, SIGKILL); + int check_killed_retries = 10; + while (killpg(pid, 0) == 0) { + if (check_killed_retries-- > 0) { + sleep(1); + } else { + die(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR, + "Attempted to kill stale blaze server process (pid=%d) using " + "SIGKILL, but it did not die in a timely fashion.", pid); + } + } return true; } |