[FIX] server: ensure that the error message is flushed

When Odoo intercept the SIGXCPU signal, an error message is written to
the stderr. Unfortunately, if stderr is redirected to a buffered file, the
message will not appear.
This commit is contained in:
Christophe Monniez
2018-09-05 15:30:49 +02:00
parent f468023bd9
commit 2c09110927
+1
View File
@@ -208,6 +208,7 @@ class ThreadedServer(CommonServer):
raise KeyboardInterrupt()
elif sig == signal.SIGXCPU:
sys.stderr.write("CPU time limit exceeded! Shutting down immediately\n")
sys.stderr.flush()
os._exit(0)
elif sig == signal.SIGHUP:
# restart on kill -HUP