Skip to content

all: Use Go 1.21, new QUIC API - #9040

Merged
calmh merged 8 commits into
syncthing:mainfrom
calmh:go121quic
Aug 21, 2023
Merged

calmh merged 8 commits into
syncthing:mainfrom
calmh:go121quic

Conversation

@calmh

@calmh calmh commented Aug 16, 2023

Copy link
Copy Markdown
Member

Incomplete pending API support on the QUIC side, but this is roughly what I imagine the update would look like.

}

func (t *transportPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) {
return t.tran.WriteTo(p, addr)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hopefully this doesn't hang, but feels like adding deadline suport would make sense?

@calmh calmh Aug 19, 2023 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't know how to do that, though... I mean, we could launch the Write() on a separate goroutine and do some channel stuff with a select on a timeout channel to return in a timely fashion and just abandon the blocked Write() in the background forever, but ... is it worth it? Gut feeling says the accelerated magic stuff used under the hood may not do write timeouts, and UDP should Never(tm) block anyway as far as I can imagine

@AudriusButkevicius AudriusButkevicius Aug 19, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@marten-seemann perhaps transport should expose SetWriteDeadline from conn?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There's nothing the transport can do with a write deadline, other than setting it on the underlying connection, which would not be a good idea.

Comment thread lib/connections/quic_misc.go Outdated
}

func (t *transportPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) {
return t.tran.ReadNonQUICPacket(context.TODO(), p)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why can't we have a local var context with a timeout that is created when SetDeadline/SetReadDeadline is called, and then used instead of the TODO()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can, did that, the other was ... TODO :)

@calmh
calmh marked this pull request as ready for review August 19, 2023 15:44
quicTransport := &quic.Transport{
Conn: udpConn,
Tracer: tracer,
}

@AudriusButkevicius AudriusButkevicius Aug 19, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we quicTransport.Close() along side the udpConn.Close() ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Looks like it may not do much in the case where it didn't create the conn itself, but it also won't hurt so, yes, sure.

@calmh

calmh commented Aug 21, 2023

Copy link
Copy Markdown
Member Author

@AudriusButkevicius PTAL

@AudriusButkevicius

Copy link
Copy Markdown
Member

Lgtm

@calmh
calmh merged commit cbf0e31 into syncthing:main Aug 21, 2023
@bt90

bt90 commented Aug 21, 2023

Copy link
Copy Markdown
Contributor

This should hopefully reduce the strain of go version updates in the future as quic-go doesn't fork crypto/tls anymore:

quic-go/quic-go#2727

@calmh
calmh deleted the go121quic branch August 21, 2023 13:35
@bt90 bt90 mentioned this pull request Aug 21, 2023
calmh added a commit to calmh/syncthing that referenced this pull request Aug 21, 2023
* main:
  build: Update dependencies (syncthing#9046)
  all: Use Go 1.21, new QUIC API (syncthing#9040)
  gui, man, authors: Update docs, translations, and contributors
  script: Remove find-metrics which belongs in docs
  gui: Fix inadvertently always-false comparison (ref syncthing#7726)
  gui, man, authors: Update docs, translations, and contributors
@calmh calmh added this to the v1.24.0 milestone Aug 23, 2023
Martchus pushed a commit to Martchus/syncthing that referenced this pull request Sep 1, 2023
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Aug 20, 2024
@syncthing syncthing locked and limited conversation to collaborators Aug 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants