-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Remove a unnecessary sleep in run server #32216
Remove a unnecessary sleep in run server #32216
Conversation
I am not sure how this argument
is relevant here. The Don't we need to somehow throttle flood of new connections? |
I don't have any super strong objections to this, but I do wonder what the original motivation was for including this wait int the first place. However, I agree that we don't want to leave incoming connections to build up in Quinn with this delay, and want to get them wrapped into the Timeout future ASAP, unless we have a good reason for why this wait was included in the first place. |
This is the PR where it was added: #26043 |
The problem is it is not throttling the flood of incoming connections -- especially the ones in initializing state. See https://github.com/quinn-rs/quinn/blob/main/quinn-proto/src/endpoint.rs#L539. The rate limiting part has to be solved using a rate limiter which I will submit a PR soon. I found this alone to be very effective in limiting memory growth by starting a standalone streamer. |
Ok, that makes sense. I can approve if there are no other objections. Can you also rebase to fix the CI errors? |
7dfbc82
to
5c159a2
Compare
Codecov Report
@@ Coverage Diff @@
## master #32216 +/- ##
========================================
Coverage 82.0% 82.0%
========================================
Files 769 769
Lines 208992 209095 +103
========================================
+ Hits 171408 171497 +89
- Misses 37584 37598 +14 |
Do we need a v1.16 backport of this? |
remove sleep; and handle initializing connection as soon as available (cherry picked from commit 689ca50)
remove sleep; and handle initializing connection as soon as available (cherry picked from commit 689ca50) # Conflicts: # streamer/src/nonblocking/quic.rs
remove sleep; and handle initializing connection as soon as available
remove sleep; and handle initializing connection as soon as available
Problem
The quic streamer run_server unnecessarily sleep. This can slow down processing connection in initializing state and build up memory pressure. We do not need it as we have already used timeout when doing
Summary of Changes
Remove the unnecessary sleep.
Fixes #