don't remove closed connections from the server's accept queue#4245
Merged
marten-seemann merged 1 commit intomasterfrom Jan 19, 2024
Merged
don't remove closed connections from the server's accept queue#4245marten-seemann merged 1 commit intomasterfrom
marten-seemann merged 1 commit intomasterfrom
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4245 +/- ##
=======================================
Coverage 84.08% 84.09%
=======================================
Files 150 150
Lines 15403 15401 -2
=======================================
- Hits 12951 12950 -1
Misses 1950 1950
+ Partials 502 501 -1 ☔ View full report in Codecov by Sentry. |
sukunrt
approved these changes
Jan 19, 2024
908a1ae to
28c730d
Compare
nanokatze
pushed a commit
to nanokatze/quic-go
that referenced
this pull request
Feb 1, 2024
mgjeong
pushed a commit
to mgjeong/quic-go
that referenced
this pull request
Feb 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In preparation for #3549.
This changes the connection queuing logic on the server side. So far, if the server is falling behind on
Accepting new connections, we queue up toprotocol.MaxAcceptQueueSizeconnections. Each of these connections has a Go routine watching for the connection to close, and removes this connection from the accept queue if it is closed for any reason.I don't really see any reason to do it that way. First of all, the server should be able to keep with accepting connections, so at best this is an optimization for a corner case. Second, the server might be interested in learning why the connection was closed. It shouldn't make a difference if the connection was closed 1ms before or after it was accepted.
I hope to eventually get rid of the
handleNewConngoroutine altogether. This will require figuring out what happens to these connections when the server is closed. As of v0.40.0, closing the server doesn't close the associated connections anymore: It's now the application's responsibility to deal with these connections. However, we do need to close the connections that weren't accepted yet, since they weren't passed to the application yet. I suspect the current code has a bug here, I don't see this condition being handled anywhere.