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

   When a transaction on an HTTP/2 origin session ends before the origin 
finishes the stream (a no-activity timeout, for example), ATS closes the stream 
on its side but never sends RST_STREAM. `Http2Stream::do_io_close` sends RST 
only for client sessions, and `delete_stream` skips it because the stream is 
already marked closed.
   
   The origin therefore keeps the stream open and counts it against its 
SETTINGS_MAX_CONCURRENT_STREAMS. ATS's own count drops, so it keeps choosing 
the session. Once enough abandoned streams pile up, what happens depends on the 
origin: one that queues streams over its limit leaves every new request on the 
session waiting until it times out too; one that refuses them fails them; and 
an ATS origin closes the whole connection with COMPRESSION_ERROR.
   
   This sends RST_STREAM with CANCEL when an origin stream that is still open 
in either direction is closed. CANCEL means the stream is no longer needed, not 
that something went wrong, so it is not counted as a stream error. Without 
that, every origin stream ATS gives up on would count toward 
`proxy.config.http2.stream_error_rate_threshold`, and a run of timeouts or 
client aborts could get the origin session closed with ENHANCE_YOUR_CALM.
   
   Test: `h2/test_h2_origin_stalled_stream.py` puts ATS in front of an HTTP/2 
origin that never answers one path, with a 2 second no-activity timeout to the 
origin. It checks that the origin receives RST_STREAM with CANCEL for the 
stalled stream, that ATS sends CANCEL for no other stream (including one whose 
END_STREAM arrives in its own empty DATA frame), and that 
`proxy.process.http2.stream_errors` stays at 0. The test fails on master, where 
the origin never sees a reset, and passes with this change; with the stream 
error change reverted, the counter check fails.
   


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