Repository navigation
Don't block the server thread when a keepalive kick moves to the player region - #83
Open
ConnexionDev wants to merge 1 commit into
Open
ConnexionDev wants to merge 1 commit into
ConnexionDev wants to merge 1 commit into
Conversation
…er region. keepConnectionAlive runs on the global tick. disconnect() then waited in managedBlock for that player's region, which cannot run until the tick returns. Queue the kick onto the region and return instead.
ConnexionDev
force-pushed
the
fix/keepalive-disconnect-deadlock
branch
from
October 18, 2026 18:50
71b719e to
56ac79c
Compare
Contributor
|
Please send the thread dumps from these crashes |
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
On
ver/26.2(build26.2-11/068d8c5) a keepalive timeout freezes the whole server.MinecraftServercallskeepConnectionAlive()on the global server thread for every player.disconnect()then sees that this thread does not own the player, queues the kick onto the player region, and waits withmanagedBlock()/waitForTasks. The region cannot tick until that server tick returns, so the wait never finishes. The watchdog fires after 10 seconds. While the player is still connected, the same path logswas kicked due to keepalive timeoutagain on the next tick.Seen on 2026-10-11, 10-12, 10-16 and 10-18, each time a different player. The stuck stack is only server code:
This is not covered by #64 or #70. Both fixes are already in
068d8c5, andver/26.3still has the same wait.Change
In
ServerCommonPacketListenerImpl:scheduleTaskthe kick onto that player's region and return. Do not callmanagedBlockorwaitable.get().Test plan
ver/26.2with this patch applied.