import types
from tornado import ioloop
+from tornado import process
try:
import signal
if _reload_attempted:
# We already tried to reload and it didn't work, so don't try again.
return
+ if process.task_id() is not None:
+ # We're in a child process created by fork_processes. If child
+ # processes restarted themselves, they'd all restart and then
+ # all call fork_processes again.
+ return
for module in sys.modules.values():
# Some modules play games with sys.modules (e.g. email/__init__.py
# in the standard library), and occasionally this can cause strange