If aiozmp RPC server is terminated with KeyboardInterrupt (e.g. ctrl+c), there is inexplicable mess of asyncio.CancelledError being logged for every pending remote request - instead of replying back to the caller with a serialized exception, like it is the case for any other exception being raised (and then exiting cleanly). This happens because you only catch Exception, but KeyboardInterrupt does not inherit from it.
KeyboardInterrupt should be caught here, in addition to Exception:
and also here:
You'd need to reply to caller (same as on other exceptions) and then re-raise or somehow exit cleanly.
IfaiozmpRPC server is terminated withKeyboardInterrupt(e.g. ctrl+c), there is inexplicable mess ofasyncio.CancelledErrorbeing logged for every pending remote request - instead of replying back to the caller with a serialized exception, like it is the case for any other exception being raised (and then exiting cleanly). This happens because you only catchException, butKeyboardInterruptdoes not inherit from it.KeyboardInterruptshould be caught here, in addition toException:aiozmq/aiozmq/rpc/rpc.py
Line 341 in 1cde8c6
and also here:aiozmq/aiozmq/rpc/base.py
Line 243 in 1cde8c6
You'd need to reply to caller (same as on other exceptions) and then re-raise or somehow exit cleanly.