bneradt commented on PR #14017:
URL: https://github.com/apache/trafficserver/pull/14017#issuecomment-6864430960

   @bryancall Thanks for the detailed analysis and the numbers. Fixed in 
f296da1f70.
   
   `Http3App::_handle_bidi_stream_on_read_complete()` now leaves the stream 
alone while its WRITE_COMPLETE is still queued (`!adapter->is_writable() && 
!adapter->has_pending_write_complete_event()`), and 
`_handle_bidi_stream_on_write_complete()` deletes it after the transaction has 
passed WRITE_COMPLETE on to HttpSM. It's your approach with one change: the 
check looks only at `_write_complete_event`, not `_write_ready_event`. Once the 
FIN is sent, `send_data()` has already queued a WRITE_COMPLETE (or it has run), 
so a WRITE_READY left in the queue does nothing; the transaction sees no 
progress and doesn't signal. If READ_COMPLETE waited on that WRITE_READY, 
though, the stream would never be deleted, because the WRITE_READY handler 
doesn't delete streams. That would bring the leak back.
   
   On the test: `test_h3_stream_reclamation.py` now also sends 96 requests, 8 
at a time, with the FIN 0 to 5 ms after the headers and 100 B to 10 KB 
generator responses. The client keeps the connection open while it waits for 
every request path to show up in the access log, so a transaction that only 
gets torn down at connection close counts as a failure. Results:
   
   | Build | Result |
   |---|---|
   | 319c5f882b | failed 3 of 3 runs: 5, 10 and 11 of 106 requests unlogged, 
all `fin-after-headers` |
   | f296da1f70 | passed 8 of 8 runs, every stream also deleted while the 
connection was open |
   
   The 35 h3/qmux/quic/http3 Uranium tests pass (26 passed, 9 skipped for 
quiche, QMux and a manual test).
   
   I also took both comment nits: the `write_stream()` doc now says the FIN is 
committed "exactly when" all bytes are accepted, and `cancel_pending_events()` 
now says the handlers that receive the events dereference `stream()`.
   


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