Make important users fetch thread a daemon thread - #251
Merged
Merged
Conversation
The thread downloading the important users list was non-daemon and has no timeout. Since the 26.3 client no longer calls System.exit on quit, a stalled download could keep the JVM alive after quitting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vnbsy6rjJEtuZqgw36BQ7d
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.
Problem
ImportantUsers.checkAll()runs on every startup, on all loaders. It downloadsusers.txton a non-daemon thread, andIOUtils.toString(URL)has no timeouts.The MC 26.3 client no longer calls
System.exit(0)on quit, and on NeoForge the vanilla shutdown watchdog fallback crashes (FML closes theminecraftmodule first). So if that download stalls, for example on a network that silently drops packets, quitting the game hangs until the download finishes or the process is killed. Normally the thread ends within a second, so this is unlikely in practice.Related: CyclopsMC/IntegratedDynamics#1758, CyclopsMC/IntegratedTerminals#231.
Fix
Create the thread as a named daemon thread through a small
createThreadhelper.Tests
TestImportantUsers#testThreadIsDaemon. I checked that it fails withsetDaemon(false)and passes with the fix../gradlew buildpasses, andrunGameTestServerpasses on NeoForge, Forge and Fabric.🤖 Generated with Claude Code
https://claude.ai/code/session_01Vnbsy6rjJEtuZqgw36BQ7d
Generated by Claude Code