You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even when a stream is closed, H2Connection keeps the object around indefinitely. In the short term this is useful because it allows us to handle late frame arrival, but in the long term this costs memory, and also hurts performance when we scan over the streams to check which ones are open, as we will need to scan over every stream that has ever been sent.
We should come up with a policy for expiring old streams.
The text was updated successfully, but these errors were encountered:
I took a quick look at nghttp2's code. It seems that nghttp2 allows up to MAX_CONCURRENT_STREAMS total state, including closed streams. We should be safely able to do that.
However, we should also make sure we don't get too aggressive about missing streams. For example, we need to tolerate receiving frames for streams that we have "forgotten": in most cases we want to send RST_STREAM if that happens, though for RST_STREAM we want to just quietly accept it, and for HEADERS we want to GOAWAY (PROTOCOL_ERROR).
This is do-able, but it's a fairly large chunk of functionality. Still worth doing though.
If we do this, we can also probably safely remove the closed streams altogether, rather than letting up to SETTINGS_MAX_CONCURRENT_STREAMS of them hang around. nghttp2 requires that for its priority implementation, but our priority implementation is going to be standalone and so will not require the information present in H2Connection.
Even when a stream is closed,
H2Connection
keeps the object around indefinitely. In the short term this is useful because it allows us to handle late frame arrival, but in the long term this costs memory, and also hurts performance when we scan over the streams to check which ones are open, as we will need to scan over every stream that has ever been sent.We should come up with a policy for expiring old streams.
The text was updated successfully, but these errors were encountered: