[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 me

[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 <https://bugs.python.org/issu

[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 moni

[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

[issue41280] lru_cache on 0-arity functions should default to maxsize=None

2020-07-11 Thread Tom Forbes
New submission from Tom Forbes : `functools.lru_cache` has a maxsize=128 default for all functions. If a function has no arguments then this maxsize default is redundant and should be set to `maxsize=None`: ``` @functools.lru_cache() def function_with_no_args(): pass ``` Currently you

[issue31076] http.server should correctly handle HTTP 1.1 responses without a content-length

2017-07-31 Thread Tom Forbes
Tom Forbes added the comment: Django recently switched to HTTP 1.1 on their development server, and it works fine as long as the middleware is included that generates the content length. Using a 'bare' Django project with no middleware the server will just hang. It sounds like the e

[issue31076] http.server should correctly handle HTTP 1.1 responses without a content-length

2017-07-29 Thread Tom Forbes
New submission from Tom Forbes: The builtin http.server module does not support HTTP keep-alive when sending a response without a content-length. This causes any clients to hang waiting on more response data, while the server hangs waiting for the client to send another request. This is