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

Occassionally with HTTP2, server does not send "End Stream" flag as True when all the data has been sent in response #226

Open saudawar opened 6 months ago

saudawar commented 6 months ago

Hypercorn Version: 0.16.0 Python Version: 3.9.18 Operating system: Oracle linux 8 Environment: Kubernetes

We have observed that when HTTP2 protocol is used, then server occassionally does not set the "End Stream" in the last datagram of the response.

From application point of view, complete data (JSON formatted) has been sent over multiple datagrams. It is expected that the server must set End Stream flag to True to indicate to client that complete data has been sent but this is not observed some times.

This has mostly been observed when response data size is large and spans over multiple datagrams as depicted in the attached screenshot.

image

In packet 4256, all the data is complete as verified from the sent bytes but the appropriate flags are not set.