Thanks to visit codestin.com
Credit goes to github.com

Skip to content

asyncio.CancelledError should be caught in "try_log" #174

@nirvana-msu

Description

@nirvana-msu

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:

except Exception as exc:

and also here:

except Exception as exc:

You'd need to reply to caller (same as on other exceptions) and then re-raise or somehow exit cleanly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions