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

   An HTTP/2 origin session stays in the pool no matter how many of its streams 
time out. When an origin stops answering streams on one connection, ATS keeps 
putting new requests on that session, and each one waits out the no-activity 
timeout before the client gets an error. Other connections to the same origin 
are unaffected, so the failures stay on the one session for as long as it lives.
   
   With this change, when an origin stream times out before its response header 
arrives, its session stops taking new streams, the same way a session stops 
after the origin's GOAWAY. The session leaves the pool, streams already on it 
finish, and it closes once the last one is gone, through the drain path ATS 
already uses after an origin's GOAWAY (the flag is renamed from 
`_peer_goaway_drain` to `_outbound_drain` to cover both). The next request 
opens a new connection. ATS does not send its own GOAWAY when the drain starts, 
because an ATS origin answers a client's GOAWAY by closing every stream on the 
connection, which would cut off the streams the drain is letting finish.
   
   A stream that times out after its response header arrived does not retire 
the session. Its body may be held back by a slow client through flow control 
or, for the active timeout, simply be long, so it is no evidence against the 
connection. Http2Stream records when it hands the final response header to the 
transaction (interim 1xx responses and trailers do not count). A client upload 
slow enough to time out before the origin answers does retire the session, at 
the cost of one new connection.
   
   Tests, in `h2/test_h2_origin_stream_timeout_retire.py`, with a 2 second 
no-activity timeout to the origin:
   - One stream gets no answer and times out while another trickles its body on 
the same session. A request made while the busy stream is still running goes 
out on a second connection, the busy stream completes on the first, and the 
first connection then closes. This fails on master, where the new request joins 
the first connection.
   - One stream gets its header and 10 bytes of its body, then stalls and times 
out. The next request reuses the same connection, which stays open. This passes 
on master and guards against retiring sessions too eagerly.
   
   `stalled_stream_origin.py` is the same file added by 
[#14051](https://github.com/apache/trafficserver/pull/14051); whichever merges 
second has no diff for it.
   


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