Skip to content

Handle update checker failures gracefully#1016

Open
Zaxoosh wants to merge 1 commit intoTerraformersMC:26.1from
Zaxoosh:codex/fix-update-checker-failures
Open

Handle update checker failures gracefully#1016
Zaxoosh wants to merge 1 commit intoTerraformersMC:26.1from
Zaxoosh:codex/fix-update-checker-failures

Conversation

@Zaxoosh
Copy link
Copy Markdown

@Zaxoosh Zaxoosh commented Apr 25, 2026

Summary

  • log update-check future failures instead of rethrowing them as runtime exceptions
  • treat malformed Modrinth update responses as a failed update check instead of a client crash
  • restore the interrupt flag when update-check requests are interrupted

Root Cause

#1011's log shows a timeout followed by a malformed/truncated Modrinth JSON response. The parser exception escaped through Future.get(), and checkForUpdates0 rethrew the ExecutionException as a RuntimeException, which crashed Minecraft.

Validation

  • ./gradlew.bat build

Fixes #1011

@Zaxoosh Zaxoosh marked this pull request as ready for review April 25, 2026 15:25
@gniftygnome gniftygnome mentioned this pull request Apr 25, 2026
@gniftygnome
Copy link
Copy Markdown
Contributor

Very good. Thank you for this.

@Zaxoosh
Copy link
Copy Markdown
Author

Zaxoosh commented Apr 25, 2026

All good, always happy to help out!

@litetex
Copy link
Copy Markdown
Contributor

litetex commented Apr 25, 2026

So regarding #972 (comment)

Okay so I missed a few returns and exceptions in #972

I think putting a

ExecutorService executor = Executors.newThreadPerTaskExecutor(new UpdateCheckerThreadFactory());
try {
  // Do stuff
} finally {
 executor.shutdown();
}

should fix this in a much cleaner way instead of putting into every if or catch block ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update check crash when request timed out

3 participants