Skip to content

Add timeouts to all remote fetches in RemoteHandler - #25

Draft
PLASMAchicken wants to merge 1 commit into
masterfrom
fix/remote-fetch-timeouts
Draft

Add timeouts to all remote fetches in RemoteHandler#25
PLASMAchicken wants to merge 1 commit into
masterfrom
fix/remote-fetch-timeouts

Conversation

@PLASMAchicken

Copy link
Copy Markdown
Member

Summary

The three JSON fetches (version manifest, version details, asset index) used IOUtils.toString(URL), which opens the connection without connect/read timeouts. On networks that silently drop packets (captive portals, filtering proxies), the TLS handshake to launchermeta.mojang.com blocks forever, freezing the game during coremod injection (RemoteHandler.getVersions is called unconditionally from TXLoaderCore.injectData).

All remote connections now go through a shared openStream helper with uniform timeouts (5s connect / 10s read), replacing the duplicated timeout setup in downloadJar and JAsset.download. On timeout, getVersions() fails fast and the game launches normally with isRemoteReachable = false.

Fixes https://canary.discord.com/channels/181078474394566657/1466025211840172112/1522342366764208229

Threaddump threaddump.txt

UsersFix:

so, 2-4 days ago, my router was moved ~5 meters away from me. I've also noticed, when trying to download something on the internet, the windows smartscreen is also delayed, it opens way slower. So, i connected to my phone hotspot and.... GTNH ACTUALLY OPENED?? with the help of gemini and a succesfull threaddump, i've converted it into a txt file, then gave it to gemini and it said that TXloader couldn't download some resources... YEAH I DONE DID IT!

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

The three JSON fetches (version manifest, version details, asset index)
used IOUtils.toString(URL), which opens the connection without
connect/read timeouts. On networks that silently drop packets (captive
portals, filtering proxies), the TLS handshake to launchermeta.mojang.com
blocks forever, freezing the game during coremod injection
(RemoteHandler.getVersions is called unconditionally from
TXLoaderCore.injectData).

All remote connections now go through a shared openStream helper with
uniform timeouts (5s connect / 10s read), replacing the duplicated
timeout setup in downloadJar and JAsset.download. On timeout,
getVersions() fails fast and the game launches normally with
isRemoteReachable = false.
@PLASMAchicken
PLASMAchicken requested a review from glowredman July 5, 2026 11:01
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.

1 participant