mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-26 04:32:51 +01:00
control: log remaining threads on shutdown, for debugging freezes
This commit is contained in:
parent
95b58fc2c4
commit
e7a005b685
@ -3,6 +3,7 @@ control.py - Implements SHUTDOWN and REHASH functionality.
|
|||||||
"""
|
"""
|
||||||
import signal
|
import signal
|
||||||
import os
|
import os
|
||||||
|
import threading
|
||||||
|
|
||||||
from pylinkirc import world, utils, conf, classes
|
from pylinkirc import world, utils, conf, classes
|
||||||
from pylinkirc.log import log, makeFileLogger, stopFileLoggers
|
from pylinkirc.log import log, makeFileLogger, stopFileLoggers
|
||||||
@ -40,6 +41,10 @@ def _shutdown(irc=None):
|
|||||||
except OSError:
|
except OSError:
|
||||||
log.exception("Failed to remove PID, ignoring...")
|
log.exception("Failed to remove PID, ignoring...")
|
||||||
|
|
||||||
|
log.info("Waiting for remaining threads to stop; this may take a few seconds. If PyLink freezes "
|
||||||
|
"at this stage, press Ctrl-C to force a shutdown.")
|
||||||
|
log.debug('_shutdown(): Remaining threads: %s', ['%s/%s' % (t.name, t.ident) for t in threading.enumerate()])
|
||||||
|
|
||||||
# Done.
|
# Done.
|
||||||
|
|
||||||
def sigterm_handler(signo, stack_frame):
|
def sigterm_handler(signo, stack_frame):
|
||||||
|
Loading…
Reference in New Issue
Block a user