Skip to content

Commit 30d8ff4

Browse files
committed
session: gracefully stop on interrupts
Remove task cancellation on interrupts as it doesn't fit our needs. Cancelling tasks only stops running coroutines, but the application still halts without terminating test executables. Now, we handle exceptions properly and stop the session gracefully. Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
1 parent cc73035 commit 30d8ff4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libkirk/main.py

+2
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ async def session_run() -> None:
382382
await monitor.stop()
383383

384384
loop = libkirk.get_event_loop()
385+
exit_code = RC_OK
385386

386387
try:
387388
loop.run_until_complete(
@@ -398,6 +399,7 @@ async def session_run() -> None:
398399
try:
399400
# at this point loop has been closed, so we can collect all
400401
# tasks and cancel them
402+
loop.run_until_complete(session.stop())
401403
libkirk.cancel_tasks(loop)
402404
except KeyboardInterrupt:
403405
pass

0 commit comments

Comments
 (0)