From 9d2c513d41368d4932ea3e6207cbb248d5d8c9ee Mon Sep 17 00:00:00 2001 From: Indrajit Bhosale Date: Wed, 8 May 2024 20:11:45 -0700 Subject: [PATCH] Add error handling in case of AutocompleteStub Failure for DLIS-5819 (#356) * DLIS-5819 * Guard WaitForStubProcess in case of failed auto-complete-config --- src/stub_launcher.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stub_launcher.cc b/src/stub_launcher.cc index 9dc2a64a..828228e6 100644 --- a/src/stub_launcher.cc +++ b/src/stub_launcher.cc @@ -787,7 +787,11 @@ StubLauncher::WaitForStubProcess() CloseHandle(stub_pid_.hThread); #else int status; - waitpid(stub_pid_, &status, 0); + if (stub_pid_ != 0) { + // Added this check to ensure server doesn't hang waiting after stub + // process has already be killed and cannot be waited on + waitpid(stub_pid_, &status, 0); + } #endif }