bug(connection): configuration transition silently consumes valid keepalive replies #2
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
6b6t/FasterVelocity#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A valid backend keepalive reply can be silently consumed during the CONFIG→PLAY transition. Reproduced locally against FasterVelocity
3b4be57f, using the realClientConfigSessionHandler.handle(FinishedUpdatePacket), realClientPlaySessionHandler.handle(KeepAlivePacket), and realConnectedPlayer.forwardKeepAlivemethods with mocked connections and a queued executor.Sequence:
VelocityServerConnection.pendingPings.ClientConfigSessionHandler.handle(FinishedUpdatePacket)immediately changes the client state to PLAY and completesconfigSwitchFuture.ConfigSessionHandlerschedules the backend's switch to PLAY viathenRunAsync(..., smc.eventLoop()). Backend bootstrap explicitly uses the client's event loop, so the scheduled continuation can run after other already-buffered client packets.ConnectedPlayer.sendKeepAliveToBackendwith client PLAY / backend CONFIG. The method removes its ID from the pending map, fails the state check, and returns true without forwarding it.The local regression expectation that the valid reply must be forwarded or retained fails:
Controls (CONFIG/CONFIG and PLAY/PLAY) both pass. The expected failure concerns reply conservation, not a demand to write a CONFIG-encoded packet to a PLAY peer. A fix should preserve state-correct encoding while retaining/draining accepted replies through the transition. It should also define handling for closed/replaced backends; do not forward old connection replies to a replacement worker.
This investigation started from production player timeouts in 6b6t/Fox#193. The same method was verified in the on-disk production FasterVelocity 4.1.1 jar by extracting
ConnectedPlayer.classand disassembling it locally. This proves the proxy defect and a deterministic local transition case, not that it explains every observed player timeout. In particular, fardy27 shows missing-response deadlines rather than out-of-order diagnostics, and Fox independently resets pending challenges on listener handoff.Evidence:
/home/xymb/6b_dev/DevelopmentFox/cache/keepalive-deep-20260911/probe.log,probe.init.gradle, andprobe/com/velocitypowered/proxy/connection/client/KeepAliveTransitionProbeTest.java. Test-only sources were supplied from the ignored evidence directory using a Gradle init script. No production source or runtime changes, uploads, restarts, or JVM attach diagnostics were performed.Scope clarification from the user: do not accommodate arbitrary bot/client quirks. This issue's local probe establishes the code's behavior for a delayed reply crossing a protocol-state boundary, but a supported/vanilla client's production of that ordering is not yet established. Treat this as a conditional investigation, not sufficient justification to relax protocol-state checks or accept arbitrary stale replies.
The stronger confirmed vanilla compatibility case is 6b6t/Fox#196: a headless method-level probe using actual Minecraft26.2 client code reproduces a newer immediate reply overtaking an older deferred reply after window-event polling unfreezes. Its normal control passes, and Fox rejects that known-ID order. That case, together with the pending-queue correctness defect in 6b6t/Fox#195, should take priority. No fixes or production changes have been made.