-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
quic: add DisableReuseport
option
#1476
quic: add DisableReuseport
option
#1476
Conversation
1365b5e
to
0173e41
Compare
The QUIC tests were very flaky, and we've cleaned them up since. Could you rebase this PR on the current master? |
0173e41
to
e88abfa
Compare
e88abfa
to
8c5b669
Compare
I just rebased the branch on master, it seems that all the concerned tests pass now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly looks good. I added a few comments.
require.Equal(t, serverConn.RemotePeer(), clientID) | ||
require.True(t, serverConn.RemotePublicKey().Equals(clientKey.GetPublic()), "remote public key doesn't match") | ||
} | ||
for _, tc := range connTestCases { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please introduce a separate function, so you don't have to indent everything here.
} | ||
|
||
func TestResourceManagerSuccess(t *testing.T) { | ||
serverID, serverKey := createPeer(t) | ||
clientID, clientKey := createPeer(t) | ||
for _, tc := range connTestCases { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
p2p/transport/quic/options.go
Outdated
|
||
type Option func(opts *Config) error | ||
|
||
type Config struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be exported.
p2p/transport/quic/transport.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
return reuse.Listen(network, laddr) | ||
return newNoReuseConn(conn), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This doesn't need a constructor, just use noreuseConn{Conn: conn}
.
8327714
to
f202713
Compare
Signed-off-by: gfanton <[email protected]>
f202713
to
eacccb5
Compare
close listener underlying connection when reuseport is disabled and the close method called Signed-off-by: gfanton <[email protected]>
eacccb5
to
93bf6d6
Compare
I've made the requested changes, but I've missed some
thanks ! |
Hole punching is only expected to work with reuseport enabled. You can disable that test for the non-reuseport version (please add a comment why!). |
Signed-off-by: gfanton <[email protected]>
done 👍 |
One test is failing, but it doesn't seem to be related to my PR. |
DisableReuseport
option to quic-transportDisableReuseport
option
Moved from libp2p/go-libp2p-quic-transport#272
Fixes #1428
Hey, I just started to add the
DisableReuseport
options to quic transport. It seems to be working as expected with some cellular operators that couldn't maintain the connection (I tried with this script https://github.com/gfanton/libp2p-reuseport-test)Just some few things:
conn_tests
with a simple table test case to test everything conn related with the reuseport_on/offnet.ListenUDP
instead ofnet.DialUDP
for the Dial method to work, otherwise the call to theWriteTo
method fails.Also there are two tests that currently fail with the reuseport disabled:
TestHolePunching
TestStatelessReset
Do these tests make sense when used with resuseport disabled?