[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2022-03-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: I am still not convinced that audit events should be used. Maybe support of explicit callbacks pair (on_start() + on_finish()) with `None` for fast-and-cheap "do nothing flag" is a better alternative for catching stale coroutines? -- __

[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Tom Forbes
Tom Forbes added the comment: Actually reacting to a stall would require something more and probably should be done at some point. But this is purely about monitoring - in our use case we'd send a metric via statsd that would be used to correlate stalls against other service level metrics.

[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Steve Dower
Steve Dower added the comment: Fundamentally I don't have an issue with the audit hook. My only concern would be if there's anything that an application may do to _respond_ to a stall (e.g. is this valuable for applying backpressure? etc.) If it's purely diagnostic, and there's nothing you'd

[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Tom Forbes
Change by Tom Forbes : -- keywords: +patch pull_requests: +24642 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25990 ___ Python tracker ___ _

[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Tom Forbes
Tom Forbes added the comment: I don't see why we shouldn't use PEP 578 for this - the events provide rich monitoring information about what a Python process is "doing" with an easy, central way to register callbacks to receive these events and shovel them off to a monitoring solution. Is th

[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Christian Heimes
Christian Heimes added the comment: Are you proposing to use PEP 578 for monitoring the event loop? -- nosy: +christian.heimes, steve.dower ___ Python tracker ___

[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Tom Forbes
New submission from Tom Forbes : Detecting and monitoring loop stalls in a production asyncio application is more difficult than it could be. Firstly you must enable debug mode for the entire loop then you need to look for warnings outputted via the asyncio logger. This makes it hard to send