ModsFinder

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.

FabricServer-side onlyCC0 1.0 UniversalOpen source1.20.1 – 1.21.1

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

  1. Stray thread detection

    During server shutdown, the mod scans for non-daemon threads that have not finished, which is the cause of most hangs.

  2. 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.

  3. Halt signal

    If threads are still running after the grace period, a halt signal is sent so the server stops and the console returns.

  4. 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.

1.21.11.0.1-1.21.1
1.20.11.0.0
ReleaseBetaAlphaNot available

Only full game releases are shown. This mod publishes no snapshot builds.

Requirements

Dependencies declared by the latest file for each loader.

Required 1

Fabric Language KotlinThis is a mod that enables usage of the Kotlin programming language for Fabric mods.
Required

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?

Yes. Fabric Language Kotlin is a required dependency and must be installed alongside the mod.

Does the mod have to be installed on the client?

No. Server owners install it, and players connect with no copy of their own.

Which game versions have files?

Files exist for 1.20.1 and 1.21.1, and the latest Fabric build, 1.0.1-1.21.1, targets 1.21.1.

Can the grace period be changed?

Yes. The 5-second wait before the halt signal is configurable.

More from lilpebs

All projects

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…
lilpebs, on the Modrinth page

Official listing

Owner
lilpebs
Published
2024-11-28
Updated on Modrinth
2025-01-01
Facts verified
2026-10-15