mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-12 20:27:17 +00:00
Avoid treating supervisord's SIGTERM as an error in CommandEventHandler
This commit is contained in:
parent
94dee63a41
commit
3bfe6db036
@ -127,6 +127,9 @@ class CommandEventHandler(PipeIOEventHandler):
|
|||||||
@terminate_process_on_failure
|
@terminate_process_on_failure
|
||||||
def _monitor_proc(self):
|
def _monitor_proc(self):
|
||||||
return_code = self._proc.wait()
|
return_code = self._proc.wait()
|
||||||
|
if return_code == -int(SIGTERM):
|
||||||
|
# supervisord asked the program to terminate, this is fine
|
||||||
|
return
|
||||||
if return_code != 0:
|
if return_code != 0:
|
||||||
_, stderr = self._proc.communicate()
|
_, stderr = self._proc.communicate()
|
||||||
raise RuntimeError(f'Subprocess failed ({return_code})! Stderr:\n{stderr.decode()}')
|
raise RuntimeError(f'Subprocess failed ({return_code})! Stderr:\n{stderr.decode()}')
|
||||||
|
Loading…
Reference in New Issue
Block a user