raven-python icon indicating copy to clipboard operation
raven-python copied to clipboard

Add the Client.install_asyncio_hook function.

Open Kentzo opened this issue 7 years ago • 10 comments

asyncio needs special handling as its unhandled exceptions are consumed by logging and ignoring them.

@asvetlov Please take a look at the implementation and let me know if handling can be improved. I used implementation of BaseEventLoop.default_exception_handler as a reference but didn't check all available context's keywords in all released versions of Python.

Kentzo avatar Nov 12 '17 01:11 Kentzo

I'm not sure how to cause asyncio to call exception handler without 'exception' but with handle of future with the _source_traceback attribute set.

Kentzo avatar Nov 13 '17 03:11 Kentzo

@ashwoods I used the 'exception' level instead of 'fatal' as handled errors don't explicitly cause interpreter to exit by default. Was it a good idea?

Kentzo avatar Nov 13 '17 03:11 Kentzo

@ashwoods Is there anything I should change / fix?

Kentzo avatar Nov 20 '17 22:11 Kentzo

The idea is strange for me. Why is it a part of raven-python? I thought raven-aiohttp is better place for asyncio-related things.

asvetlov avatar Nov 21 '17 21:11 asvetlov

@asvetlov This change is to handle asyncio exceptions and unrelated to aiohttp transport.

In one of the projects we are using this without raven-aiohttp.

Kentzo avatar Nov 22 '17 01:11 Kentzo

@ashwoods I would love to address the issues if there are any

Kentzo avatar Jan 25 '18 21:01 Kentzo

Anyone? I'm willing to fix any issues.

Kentzo avatar Mar 30 '18 00:03 Kentzo

I haven't had time to look into context in the loop. Will breadcrumbs leak and be cleared?

ashwoods avatar Mar 30 '18 06:03 ashwoods

@ashwoods What test would show it?

Kentzo avatar May 30 '18 20:05 Kentzo

Re-opened to re-run CI tests.

@ashwoods Any thoughts?

Kentzo avatar Aug 15 '18 19:08 Kentzo