Skip to content

Commit

Permalink
ignore ChildProcessError
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Indenbaum <[email protected]>
  • Loading branch information
Alexander Indenbaum committed Oct 7, 2023
1 parent 52cbba9 commit 838b698
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions control/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,12 @@ def _stop_discovery(self):

self.logger.info("Terminating discovery service...")
# discovery service selector loop should exit due to KeyboardInterrupt exception
os.kill(self.discovery_pid, signal.SIGINT)
_, exit_status = os.waitpid(self.discovery_pid, 0)
self.logger.info(f"Discovery service pid {self.discovery_pid} terminated, "
f"exit code={os.waitstatus_to_exitcode(exit_status)}")
try:
os.kill(self.discovery_pid, signal.SIGINT)
os.waitpid(self.discovery_pid, 0)
except ChildProcessError:
pass # ignore
self.logger.info("Discovery service terminated")

self.discovery_pid = None

Expand Down

0 comments on commit 838b698

Please sign in to comment.