Pebble's Stray Thread Killer
by lilpebs
Pebble's Stray Thread Killer is a Fabric server mod that forces a stuck server to close after a short wait when non-daemon threads keep it from stopping.
What it does
When a stop command is issued, the mod watches the main server thread while it shuts down and looks for non-daemon threads that are still alive. Those threads are the usual reason a server hangs at the console instead of exiting. The mod gives them a configurable grace period of 5 seconds to finish on their own before it sends a halt signal, so the process ends cleanly.
The mod is aimed at server owners who restart or stop a dedicated server and find it stuck after the shutdown command. It runs on the server alone, so players join without installing anything, and it requires Fabric Language Kotlin on Fabric. Files are published for 1.20.1 and 1.21.1, and the latest build, 1.0.1-1.21.1, targets 1.21.1. The source code is public and the code is released under CC0 1.0 Universal, a public domain dedication.
Key features
Stray thread detection
During server shutdown, the mod scans for non-daemon threads that have not finished, which is the cause of most hangs.
Configurable grace period
Straggling threads get 5 seconds by default to complete before the mod takes action, and the wait can be changed in the config.
Halt signal
If threads are still running after the grace period, a halt signal is sent so the server stops and the console returns.
Lightweight focus
The mod does one job, shutdown handling, and adds nothing else to the server.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Requirements
Dependencies declared by the latest file for each loader.
Required 1
Use cases
Restarting a dedicated server
A server that hangs on the stop command can be restarted from the console without waiting on a stuck process.
Who it’s for: Server owners running a dedicated Fabric server on 1.20.1 or 1.21.1 who see the server hang after a stop or restart command.
Questions
Does Pebble's Stray Thread Killer need Fabric Language Kotlin?
Does the mod have to be installed on the client?
Which game versions have files?
Can the grace period be changed?
More from lilpebs
What the author says
Is your server console hanging when you issue a stop command? You're not alone. This mod is designed to solve that issue by managing non-daemon threads that often fail to shut down gracefully, causing the server to hang. The Stray Thread Killer mod monitors the server thread during shutdown and detects any straggling…
Official listing
- Modrinth page
- modrinth.com/mod/pebbles-stray-thread-killer
- Owner
- lilpebs
- Published
- 2024-11-28
- Updated on Modrinth
- 2025-01-01
- Facts verified
- 2026-10-15
