Fix termination steps
Another, hopefully better attempt: Ignore the TERM signal in the sending process so that we can properly clean up all the futures before actually closing. This also avoids a "Terminated" message even on regular kas endings. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
adb4007482
commit
7248d5e1bb
@ -92,9 +92,14 @@ def _atexit_handler():
|
||||
"""
|
||||
Close event loop and terminate the whole process group
|
||||
"""
|
||||
asyncio.get_event_loop().close()
|
||||
signal.signal(signal.SIGTERM, signal.SIG_IGN)
|
||||
os.killpg(os.getpid(), signal.SIGTERM)
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
pending = asyncio.Task.all_tasks()
|
||||
loop.run_until_complete(asyncio.gather(*pending))
|
||||
loop.close()
|
||||
|
||||
|
||||
def kas_get_argparser():
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user