MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
514 stars 443 forks source link

DownloadUtils doesn't set a timeout, causing downloads to hang if a server doesn't respond #942

Open Barteks2x opened 7 months ago

Barteks2x commented 7 months ago

This is one of java's dumb default: https://github.com/MinecraftForge/ForgeGradle/blob/63b758333137a929ae37186ff8c10d1335f934d0/src/common/java/net/minecraftforge/gradle/common/util/DownloadUtils.java#L213-L237 if you don't explicitly set a timeout value, it will wait indefinitely for a response that may never arrive.

Normally this works because you either get a response or it fails. But sometimes, in some random cases of network issues, there is no response at all and it will hang, waiting forever for a nonexistent response.

LexManos commented 7 months ago

Interesting. it depends on the javac implementation it seems. Anyways if you want to set a timeout feel free to submit a pr. I'm fine with whatever as this is a dumb edge case