Repository navigation
Shut the server down when Posse is disabled while it runs - #22
Merged
Merged
Conversation
D401: a disabled plugin's listeners stop working, so home worlds, circles, chat limits and the join pause would all lift with players still online. Unless the server is already stopping, Posse now asks Paper to shut down, disconnects everyone with a plain message, and logs why. It disconnects everyone itself because Paper's stop disables every other plugin before it kicks anyone, and chat runs on its own thread, so players could otherwise still reach each other for that time. The test helper gets /mt disable, and a new bot suite, disable-guard.js, drives it while running and while paused. Tested: ./gradlew build, 275 unit tests, none skipped. disable-guard.js 21/21 on Paper 26.1.2. Not tested: disable-guard.js on 26.2 and 26.3; the full suite.js on any version (a 26.1.2 run was stopped partway for a test-server hold); /reload itself, a plugin error, a failed shutdown and a disable off the main thread. Task: K964 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
suite.js passed 87 of 87 on Paper 26.1.2 with the disable change (3 skipped: sign text and anvil renames need a real client, graves need a LanternGraves jar). disable-guard.js and suite.js on 26.2 and 26.3 are still not run. Task: K964 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
disable-guard.js passed 21 of 21 and suite.js 87 of 87 (3 skipped) on Paper 26.1.2 build 74, 26.2 build 135 and 26.3 build 273, each on a throwaway local server deleted after the run. The changelog heading drops "not released" so the release only needs the merge and the tag. Still not tested: /reload itself, a plugin error that disables Posse, a failed shutdown, an off-thread disable, and a real game client. Task: K964 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgilardi
marked this pull request as ready for review
December 2, 2026 03:09
The checks were skipped while it was a draft, and marking it ready does not start them. Task: K964 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
D401 (K964). If Posse is disabled while the server runs and the server isn't already stopping, Posse:
Step 2 is there because Paper's stop disables every other plugin before it disconnects anyone, and chat runs on its own thread. Without it, players could keep reaching each other after Posse's listeners were gone. Each step runs even if the one before it fails, and nothing escapes
onDisable. A normal stop is left alone. If the server can't say whether it's stopping, it's treated as running.Limits: this can't cover a removed jar, a plugin that never loads, a killed process, or another plugin removing Posse's listeners without disabling it. Off the main thread, kicks aren't possible, so the server's own stop disconnects players a little later.
The test helper gets
/mt disable <plugin>(test-only, never shipped).Tested
./gradlew build: 275 unit tests pass, none skipped. Seven are inDisableGuardTest.disable-guard.js, a new bot suite: 21 of 21 on Paper 26.1.2, 26.2 and 26.3. A normal stop says nothing. Disabled with two players online, the server exits by itself (about 1 s) and both players get Posse's message. The same happens while Posse is paused on a broken config. Afterwards the server restarts and lets a player in.suite.js(startup, pause, joins and everything else): 87 of 87 on each of the three versions, 3 skipped (sign text and anvil renames need a real client; graves need a LanternGraves jar).Not tested yet
/reloaditself, an error that makes Paper disable the plugin, a failed shutdown, and a disable from off the main thread.Released as 0.11.4, not 0.11.3 (D402).
🤖 Generated with Claude Code