Repository navigation
Don't send keepalive until the client acknowledges FinishedUpdate - #281
Open
KamikotoTkach wants to merge 1 commit into
Open
KamikotoTkach wants to merge 1 commit into
KamikotoTkach wants to merge 1 commit into
Conversation
The keepalive task starts right after the CONFIG -> PLAY switch packets are written, with a 250 ms initial delay. If the client is still applying the registries when it fires, a PLAY keepalive reaches it between sending its FinishConfiguration acknowledgement and installing the PLAY outbound protocol; the client answers it immediately and disconnects with "Pipeline has no outbound protocol configured, can't process packet ServerboundKeepAlivePacket". Vanilla servers send nothing in this window, so skip keepalive ticks until the play transition completes.
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.
Problem
Sometimes 26.2 clients get kicked while joining a limbo:
Reconnecting usually works.
Cause
In
LimboImpl.spawnPlayerLocal(CONFIG -> PLAY path), LimboAPI writes the config packets that end withFinishedUpdatePacket, switches the encoder to PLAY and callsonConfig. That starts the keepalive task with a 250 ms initial delay.If the client hasn't acknowledged
FinishedUpdateyet (for example, it is still applying the registry sync), the first PLAY keepalive arrives during the client's protocol switch. The client handles it after installing the PLAY inbound protocol and replies right away. If that reply lands between the client sending itsFinishConfigurationacknowledgement (a terminal packet, which unconfigures the outbound pipeline) and installing the PLAY outbound protocol, the client throws the exception above and disconnects.Vanilla servers send nothing between
FinishConfigurationand the acknowledgement, so this never happens there.Fix
Skip keepalive ticks until
playTransitioncompletes. It completes inonSpawn(), i.e. once the client has acknowledged the switch, or immediately on the paths that never go through CONFIG (<1.20.2, or PLAY without rejoin). Skipped ticks don't count as missed keepalives, so a slow registry load can't cause a timeout kick from LimboAPI either.🤖 Generated with Claude Code