Skip to content

Commit

Permalink
Replace reaping with less involved process
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvanrun committed Aug 1, 2024
1 parent 6c8f8b1 commit 42da732
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,11 @@ def _terminate_child_processes():
except psutil.NoSuchProcess:
pass # That is fine

_reap_all_children()


def _reap_all_children():
"""Reaps all child processes that have terminated"""
# Finally, prevent zombies by waiting for all child processes
try:
while True:
pid, _ = os.waitpid(-1, os.WNOHANG)
if pid == 0: # No more terminated child processes
break
os.waitpid(-1, 0)
except ChildProcessError:
pass # No more child processes
pass # No child processes, that if fine


def listen_to_children_errors():
Expand Down

0 comments on commit 42da732

Please sign in to comment.