Repository navigation
feat(velocity): pace drain transfers instead of sending them all at once - #85
Merged
Merged
Conversation
A drain sent every transfer packet in the same instant, so a full proxy reconnected in one burst: hundreds of logins, Mojang session checks and service lookups on the replacement proxy at once. Transfers now go out in batches of GROUNDS_DRAIN_TRANSFERS_PER_SECOND (default 20) once a second, at drain start and at the deadline. A queued player who left or walked into a round is skipped without using a slot.
|
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.



Previously the proxy drain sent every transfer packet at the same moment, at drain start and again at the deadline. 400 players on one proxy meant 400 reconnects within a second: logins, Mojang session checks and service lookups all hitting the new proxy together.
Now:
PacedTransfers: the first batch goes out immediately, then one batch per second. The rate isGROUNDS_DRAIN_TRANSFERS_PER_SECOND, default 20, so 400 players take 20 s, well within the 830 s deadline.interceptConnectonce their round ends.OutdatedLobbyMover) was already staggered (10 per 5 s per proxy) and is unchanged.Tests:
PacedTransfersTestcovers batching 45 → 20/20/5, skipping without using a slot, failure handling (it absorbs the oldDrainTransferSafetyTest), and the config default and validation../gradlew :velocity:test spotlessCheck buildis green.