Skip to content

Commit 5acf3a4

Browse files
committed
install signal handlers only for the main program
fixes #3650
1 parent 92ce674 commit 5acf3a4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docker/start.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ def main():
571571

572572
start_rest_thread(logger)
573573

574+
# Ideally the signal handlers should be installed as early as possible,
575+
# however that does not play well with the worker pool communication used by do_sync().
576+
signal.signal(signal.SIGTERM, signal_handler)
577+
signal.signal(signal.SIGINT, signal_handler)
578+
574579
# Start Tomcat last. It will be the foreground process.
575580
logger.info("Starting Tomcat")
576581
global tomcat_popen
@@ -592,7 +597,4 @@ def signal_handler(signum, frame):
592597

593598

594599
if __name__ == "__main__":
595-
signal.signal(signal.SIGTERM, signal_handler)
596-
signal.signal(signal.SIGINT, signal_handler)
597-
598600
main()

0 commit comments

Comments
 (0)