bryancall opened a new pull request, #13961:
URL: https://github.com/apache/trafficserver/pull/13961

   A request forwarded to an HTTP/2 origin could leave its stream open. The 
origin waited for the rest of a request that was already complete, and the 
client got a 504 once ATS gave up. Three paths did this:
   
   - **The client's body turned out to be empty.** An HTTP/2 client can send 
HEADERS without END_STREAM and then an empty DATA frame with END_STREAM, and an 
HTTP/1.1 client can send an empty chunked body. The request body tunnel 
completed its origin consumer without writing to it, and the origin stream 
sends END_STREAM only when a write completes. The tunnel now gives an HTTP/2 
origin consumer a zero length write for an empty body.
   - **A POST, PUT or PUSH without Content-Length was assumed to carry a 
body.** HEADERS went out without END_STREAM even when the client had already 
ended its request, and no tunnel followed to end it. Whether a body follows now 
comes from one HttpSM predicate, `forwards_client_request_body()`, which the 
tunnel setup also uses, so TRACE and plugin-supplied bodies are handled the 
same way in both places.
   - **A header block too large for one frame.** The END_STREAM decision sat 
inside the single HEADERS frame branch, so a request split into HEADERS and 
CONTINUATION never ended. The decision is now made before the block is split, 
and END_STREAM stays on HEADERS as RFC 9113 requires. The response decision 
moves with it, which keeps the two in one place; responses with large headers 
already ended correctly.
   
   The same predicate also stops a chunked HTTP/1.1 request with a method 
outside POST, PUT and PUSH, such as PATCH, from going out with END_STREAM on 
its HEADERS while its body is still to come.
   
   The new Uranium test `test_h2_origin_request_end_stream.py` sends each way 
of ending a request through ATS to an HTTP/2 origin that answers only once the 
request stream has ended, and checks which frame carried END_STREAM. The 28 
cases cover HTTP/2 and HTTP/1.1 clients, Content-Length and chunked bodies, a 
client that ends its body after a pause, and a 30000 byte request header.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to