Skip to content
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

net/http: merge http2 Transport dials #13397

Closed
ghost opened this issue Nov 25, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@ghost
Copy link

commented Nov 25, 2015

Instead of multiplexing streams, concurrent longpoll HTTP2 connections always create new connection, unless it's preceded by a complete roundtrip.

This code will reuse connection

getOnce()
for i:=0;i<10;i++{
        go blockingLongPoll()        
}

while this code doesn't (as shown by netstat)

for i:=0;i<10;i++{
        go blockingLongPoll()        
}

complete test is in this gist

go version devel +e5956bc linux/amd64

@bradfitz

This comment has been minimized.

Copy link
Member

commented Nov 30, 2015

This has nothing to do with long polling, and nothing to do with whether RoundTrip completes or not. This is simply the case of the Transport not merging outgoing dials when a connection doesn't exist. There was even a TODO in the code for this already. Fix coming.

@bradfitz bradfitz modified the milestones: Go1.6, Unplanned Nov 30, 2015

@bradfitz bradfitz changed the title net/http: HTTP2 longpoll doesn't multiplex net/http: merge http2 Transport dials Nov 30, 2015

@gopherbot

This comment has been minimized.

Copy link

commented Nov 30, 2015

CL https://golang.org/cl/17134 mentions this issue.

@golang golang locked and limited conversation to collaborators Dec 1, 2016

c3mb0 pushed a commit to c3mb0/net that referenced this issue Apr 2, 2018

http2: merge duplicate Transport dials
Fixes golang/go#13397
Updates golang/go#6891

Change-Id: I1e4c7bfe60c6abf9a03f2888aa6abc3891c309e7
Reviewed-on: https://go-review.googlesource.com/17134
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.