MCPcopy
hub / github.com/benoitc/gunicorn / reap_dirty_arbiter

Method reap_dirty_arbiter

gunicorn/arbiter.py:900–929  ·  view source on GitHub ↗

\ Reap the dirty arbiter process if it has exited.

(self)

Source from the content-addressed store, hash-verified

898 self.dirty_arbiter = None
899
900 def reap_dirty_arbiter(self):
901 """\
902 Reap the dirty arbiter process if it has exited.
903 """
904 if not self.dirty_arbiter_pid:
905 return
906
907 try:
908 wpid, status = os.waitpid(self.dirty_arbiter_pid, os.WNOHANG)
909 if not wpid:
910 return
911
912 if os.WIFEXITED(status):
913 exitcode = os.WEXITSTATUS(status)
914 if exitcode != 0:
915 self.log.error("Dirty arbiter (pid:%s) exited with code %s",
916 wpid, exitcode)
917 else:
918 self.log.info("Dirty arbiter (pid:%s) exited", wpid)
919 elif os.WIFSIGNALED(status):
920 sig = os.WTERMSIG(status)
921 self.log.warning("Dirty arbiter (pid:%s) killed by signal %s",
922 wpid, sig)
923
924 self.dirty_arbiter_pid = 0
925 self.dirty_arbiter = None
926 except OSError as e:
927 if e.errno == errno.ECHILD:
928 self.dirty_arbiter_pid = 0
929 self.dirty_arbiter = None
930
931 def manage_dirty_arbiter(self):
932 """\

Callers 2

handle_chldMethod · 0.95
stopMethod · 0.95

Calls 3

errorMethod · 0.45
infoMethod · 0.45
warningMethod · 0.45

Tested by

no test coverage detected