Delete H2 stream before destroy#2774
Conversation
| if (terminate_stream && reentrancy_count == 0) { | ||
| Http2ClientSession *h2_parent = static_cast<Http2ClientSession *>(parent); | ||
| SCOPED_MUTEX_LOCK(lock, h2_parent->connection_state.mutex, this_ethread()); | ||
| h2_parent->connection_state.delete_stream(this); |
There was a problem hiding this comment.
These block looks similar to L667-L681 ( Http2Stream::destroy() ).
trafficserver/proxy/http2/Http2Stream.cc
Lines 667 to 681 in 6dcc822
How about calling
delete_stream() before release_stream() in Http2Stream::destroy() ?
There was a problem hiding this comment.
I think the block in destroy() is a part of safety net. That may strengthen the safety net, however, I think destroy should do only destroying, and we shouldn't depend on the safety net.
There was a problem hiding this comment.
Yes, I agree that the delete_stream/release_stream/destroy relationship isn't very satisfying. I'll look a bit, and see if we can unify things a bit.
There was a problem hiding this comment.
I have a different fix that I'm running on a prod box for 30 minutes (a new record!). I made a change in release_stream. It was removing the stream from the connection_state. This means that the actual delete_stream would exit immediately without cleaning up the priority tree.
I must run out right now, but I'll put up another PR later this evening. Assuming the prod box doesn't go crazy before.
|
[approve ci autest] |
07d7d02 to
1ac7ff9
Compare
1ac7ff9 to
6c4d9ac
Compare
|
Testing on Docs now. |
|
Cherry-picked to 7.1.2. |
delete_stream()removes a stream frompriority_tree, but here, the stream destroy itself without callingdelete_stream(). The stream can be used during processingHTTP2_SESSION_EVENT_XMIT.I think this fixes #2207.