Repository navigation
Answer an rcon command after the tasks it queued have run - #518
Closed
lewisgibson wants to merge 5 commits into
Closed
lewisgibson wants to merge 5 commits into
lewisgibson wants to merge 5 commits into
Conversation
Folia does not register /save-all, so backup scripts bracketing a copy with save-off, save-all flush and save-on get Unknown command. See the patch for details.
Commands that Folia hands to a region, the global region or an entity scheduler reply after the command returned, so their rcon response was empty. Builds on the save-all change, which adds the pending completion mechanism. See the patches for details.
This reverts commit b34e9bf.
This reverts commit 7ef465f.
lewisgibson
marked this pull request as ready for review
October 1, 2026 21:45
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.
Many commands that Folia dispatches to a region, the global region or an entity scheduler (time, xp query, enchant, place, weather, setblock, fill, forceload, worldborder and more) send their feedback from the task they queue, after the command itself has returned. The rcon connection was answered as soon as the command returned, so the reply was empty.
While an rcon command runs, the tasks it queues through
RegionizedServer#addTask,RegionizedTaskQueue#queueTickTaskQueue,EntityScheduler#schedule(run or retired) andServerLevel#moonrise$loadChunksAsyncare tracked, and the rcon thread waits for them before it reads the response. Only the tasks the command itself queued are waited for, not the ones those tasks queue in turn, and the wait is capped at 20 seconds and happens on the rcon thread. The change is in the existingRegion Threading Basepatches (minecraft and paper), no new patch. It does not depend on #517.Tested on ver/26.2.x with 53 commands sent over rcon in a row, on an unpatched build and then on this one:
time set,time add,xp query,enchant,place feature,weather,setblock,filltwice,forceloadadd, query and remove,worldborder getandsay).say hiis empty, and it only broadcasts to the players.time set 6000answersSet minecraft:overworld to 6000 tick(s),xp queryanswersRc has 3 experience pointsandforceload add 0 0answersMarked chunk [0, 0] in minecraft:overworld to be force loaded, each within 0.1 seconds, with no errors in the log.This was done with AI (Claude Opus 5.5 and GPT Astra, high effort). I've reviewed it and tested it myself.