pgjones / hypercorn

Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.
MIT License
1.18k stars 105 forks source link

Bugfix handle an edge case during an abnormal close scenario with a statsd logger configured #222

Closed alex-anthropic closed 6 months ago

alex-anthropic commented 6 months ago

In https://github.com/pgjones/hypercorn/blob/main/src/hypercorn/protocol/http_stream.py#L114 HTTPStream calls the access log with response=None causing a bad access

davidbrochart commented 4 months ago

I backported test_abnormal_close_logging to anycorn, and strangely it fails on Trio and not on Windows. I might have done something wrong, but maybe you have ideas?