Github user zwoop commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/1117#discussion_r83908521
--- Diff: proxy/http2/Http2Stream.cc ---
@@ -675,6 +675,17 @@ Http2Stream::destroy()
}
chunked_handler.clear();
super::destroy();
+
+ // Current Http2ConnectionState implementation uses a memory pool for
instantiating streams and DLL<> stream_list for storing
+ // active streams. Destroying a stream before deleting it from
stream_list and then creating a new one + reusing the same chunk
+ // from the memory pool right away always leads to destroying the DLL
structure (deadlocks, inconsistencies).
+ // The following is meant as a safety net since the consequences are
disastrous. Until the design/implementation changes it seems
+ // less error prone to (double) delete before destroying (noop if
already deleted).
+ if (parent) {
+ static_cast<Http2ClientSession
*>(parent)->connection_state.delete_stream(this);
+ Warning("Http2Stream was about to be deallocated without removing it
from the active stream list");
--- End diff --
We are sure this is not going to produce a lot of warnings, right ? :)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---