Repository navigation
fix(sync): limit what a LAN connection can hold before its hello is done - #1832
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Summary
Connections on the local network are now bounded before they prove anything.
WsServerstops reading a socket once a few frames are queued. That needed Ktor's incoming channel bounded as well, since it queues without limit by default. A server for one session closes any further connection.LanGreeter); further ones are closed until one finishes.Related issue
None.
Change type
Validation
./gradlew --offline ... :app:testGithubDebugUnitTest --tests 'io.github.aedev.flow.sync2.*' --tests 'io.github.aedev.flow.sync.*': 489 tests, 0 failed../gradlew --offline ... ktlintCheck: passed.python3 .github/scripts/nightly_notes.py --check: passed.New
LanLimitsTest: 8 passed. With every limit removed at once, all 8 fail. With only the hello timeout removed, 3 fail.Not run on a device or between real devices. The memory bound is checked by whether a sender stalls, not measured.
./gradlew :app:assembleGithubDebug: not run locally, CI builds it../gradlew :app:testGithubDebugUnitTest: full suite not run locally, CI runs it.I manually tested the affected behavior on an Android device or emulator: not done.
Test device and Android version: none.
Risk and compatibility
Touches the transport FLOW-SYNC/1 shares: a server for one session now closes a second connection, and its queue is bounded too. A receiver that stops reading for longer than the ping timeout (45 s) now loses the connection. A flood of 16 silent connections can delay a real member's connection until they time out.