AlexModGuy / Citadel

A Library containing shared code used throughout most of my projects. Can be considered a continuation of LLibrary, of which this borrows the majority of its source code from.
25 stars 29 forks source link

WebHelper.getURLContents method sets no timeouts for java URLConnection #72

Open necauqua opened 2 years ago

necauqua commented 2 years ago

On my server I have some unsolved network issues which causes certain hosts to be unreachable in a 'the connection hangs forever' kind of way, and github's one of them.

I've disabled forge version checker so now the server actually starts for once, but from time to time the startup still hangs due to the call WebHelper.getURLContents from this mod occasionally hanging.

Setting sun.net.client.defaultConnectTimeout and similar prop for read timeout fixed this issue for me, but I figured I'd ask you to set the timeouts in that method so that less experienced server runners who get to have the same/similar exotic connection issue I'm having (the possibility is there, I think this has something to do with TLSv1.3) wont bash their head into the wall.

Default java URLConnection timeout, as you've figured, is zero/indefinite, yep