x/net/http2: serverConn.processHeaders has two error paths that don't clean up #48675
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
I continue to hunt a stream accounting bug in either the Go HTTP/2 transport and/or server. Reading code again now, I noticed:
(*serverConn).processHeaders
does:... where that
newStream
call is what's responsible for incrementing the stream count:(that's what's ultimately causing the
return sc.countError("over_max_streams", streamError(id, ErrCodeProtocol))
I'm hitting)But just after that
newStream
call are two error exit paths:Those two
return err
errors are suspect. If those happen, thencurClientStreams
can be left incremented, never to be decremented again.The decrement happens in
(*serverConn).closeStream
, which is called from:processResetStream
, reading a RSTStream frame from the client (e.g. they canceled the request)wroteFrame
, called after a frame write is successful, including handler panics. But if wereturn err
above before starting the handler, we can't ever write anything, as the handler never runs.I'm not sure whether this is what we're hitting yet, but it looks suspicious.
/cc @neild
The text was updated successfully, but these errors were encountered: