-
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: Update to quic-go v0.36.2 #2424
Conversation
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.
I don't think we should rename like
reuse.Listen is now called reuse.TransportForListen
- For our purposes the PacketConn is now replaced by Transport. This renaming makes things clearer right now but given that this will be the API of quic-go going forward, these names will feel out of place 2-3 months from now.
- The type system already provides the type of the return value so it's clear what sort of object we are getting. Plus most(all?) of these are internal to
transport/quic
so the expected type of object is also clear from the context.
IMO we should just add a long explanation in the changelog / commit message.
What do you mean by the names will feel out of place? As long as quic-go gives us a transport and as long as we are getting a Transport for listening from this method, the new name makes sense.
It's really confusing for a
While better than nothing, I think this isn't enough. We are already breaking the API by no longer returning a I'm open to changing the name from |
quic-go v0.36.2 just shipped: https://github.com/quic-go/quic-go/releases/tag/v0.36.2. |
I see your point. Thanks for the explanation.
I meant Transport in the name was redundant with the returned type But I am convinced about the renaming. I suggest we either keep it as is(the new names, I do not like naming along the lines |
conn = c | ||
return nil, errors.New("listen error") | ||
if runtime.GOOS == "windows" { | ||
t.Skip("skipping on windows. Not sure why this fails") |
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.
@marten-seemann Any clue off the top of your head why this fails? https://github.com/libp2p/go-libp2p/actions/runs/5537794470/jobs/10107022242#step:8:4371.
Presumably this means that on windows after calling OptimizeConn
the returned conn isn't a (quic.OOBCapablePacketConn)
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.
Yes, that’s right. It’s using a basicConn
on Windows: https://github.com/quic-go/quic-go/blob/418b866e3260b65496eb0d4420465e9d11b07e5f/sys_conn.go#L104
I’m becoming more and more convinced that OptimizeConn
is not the right API. We should change that in a future release.
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.
Yeah. I think if Transport has a WriteTo
that would be better. The problem is I can't treat the conn from OptimizeConn as a normal PacketConn once I give it to the Transport.
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.
We'll make that change in the v0.37 release (which drops support for Go 1.19, so we won't be able to use that release until mid August).
Do you see any blockers for this PR?
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.
No, this is fine for now. And the change will be very straightforward
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.
Just a couple of nits.
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 is nicer. Thanks. I think this one comment is the last renaming left.
// Used to send packets directly around QUIC. Useful for hole punching. | ||
WriteTo([]byte, net.Addr) (int, error) |
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.
👍
* Update go.mod files * Update to new quic-go API * More renaming * Add test back in * Workaround quic-go#3947 * Fix transitive dep * Use own pointer to packetConn * Update to quic-go v0.36.2 * Remove workaround * Embed quic.Transport * Downgrade qtls-go1-20 * Rename ConnManager.metricsTracer to mt * Close transport after test ends * Close conn when transport closes * Return better error * Avoid conflicts with parallel tests * Skip conn assert on windows * Add metrics tracer back in * Don't use tracers here * Add comment to WriteTo * Finish renaming conn -> transport where appropriate * Back out unrelated change * One more rename
quic-go changed its API in v0.35, this PR updates our usage.
Most of the changes in this PR are due to renaming things from conn -> transport. Previously we could only share a underlying socket by sharing the "connection" between quic-go dialers/listeners. quic-go v0.35.0 introduces a
Transport
that represents QUIC on a socket. ThisTransport
is what is shared between different dialers/listeners to reuse the same socket. I think that's a better abstraction since it's clear when something is getting shared vs not.A lot of the renaming is to make clear what is happening. For example,
reuse.Listen
is now calledreuse.TransportForListen
since what we actually get back from the call is aquic.Transport
. Similarly most things that were previously referencing a "conn" (as in packetconn) now reference atransport
. Hopefully this also clears up any confusion about different "connection" like objects.