8000 http2: fix request reservation when StrictMaxConcurrentStreams is enabled by mmatczuk · Pull Request #1 · mmatczuk/xnet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

http2: fix request reservation when StrictMaxConcurrentStreams is enabled #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmatczuk
Copy link
Owner
@mmatczuk mmatczuk commented Jan 8, 2025

Fix regression introduced in CL 617655. The awaitOpenSlotForStreamLocked() should not take into consideration reserved requests as they have no presence in the connection.

Fixes golang/go#70809

Change-Id: Ia23968189cbdb44dae860a1de9d32700115b28b4

Comment on lines 5441 to 5452
get := func() int {
req, _ := http.NewRequest("GET", ts.URL, nil)
res, err := tr.RoundTripOpt(req, opt)
if err != nil {
t.Error(err)
}
res.Body.Close()
return res.StatusCode
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a timeout for the test to eventually fail? Right now it hangs forever.

@@ -1800,7 +1800,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error {
return errClientConnUnusable
}
cc.lastIdle = time.Time{}
if cc.currentRequestCountLocked() < int(cc.maxConcurrentStreams) {
if int64(len(cc.streams)+cc.pendingResets) < int64(cc.maxConcurrentStreams) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust method comment accordingly.

…bled

Fix regression introduced in CL 617655. The awaitOpenSlotForStreamLocked()
should not take into consideration reserved requests as they have no presence
in the connection.

Fixes golang/go#70809

Change-Id: Ia23968189cbdb44dae860a1de9d32700115b28b4
@mmatczuk
Copy link
Owner Author
mmatczuk commented Jan 8, 2025

Updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/net/http2: when StrictMaxConcurrentStreams enabled ClientConn.ReserveNewRequest() causes stalls in request processing
2 participants
0