Skip to content

Commit 0b906a1

Browse files
committed
Merge pull request #219 from noah8713/master
Remove logging in signal handlers
2 parents 8a13c48 + 6f0e067 commit 0b906a1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

websockify/websocket.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -895,11 +895,14 @@ def terminate(self):
895895
raise self.Terminate()
896896

897897
def multiprocessing_SIGCHLD(self, sig, stack):
898-
self.vmsg('Reaping zombies, active child count is %s', len(multiprocessing.active_children()))
898+
# TODO: figure out a way to actually log this information without
899+
# calling `log` in the signal handlers
900+
multiprocessing.active_children()
899901

900902
def fallback_SIGCHLD(self, sig, stack):
901903
# Reap zombies when using os.fork() (python 2.4)
902-
self.vmsg("Got SIGCHLD, reaping zombies")
904+
# TODO: figure out a way to actually log this information without
905+
# calling `log` in the signal handlers
903906
try:
904907
result = os.waitpid(-1, os.WNOHANG)
905908
while result[0]:
@@ -909,11 +912,13 @@ def fallback_SIGCHLD(self, sig, stack):
909912
pass
910913

911914
def do_SIGINT(self, sig, stack):
912-
self.msg("Got SIGINT, exiting")
915+
# TODO: figure out a way to actually log this information without
916+
# calling `log` in the signal handlers
913917
self.terminate()
914918

915919
def do_SIGTERM(self, sig, stack):
916-
self.msg("Got SIGTERM, exiting")
920+
# TODO: figure out a way to actually log this information without
921+
# calling `log` in the signal handlers
917922
self.terminate()
918923

919924
def top_new_client(self, startsock, address):

0 commit comments

Comments
 (0)