Added timeout to IP-address retrieval in order to prevent hang and disconnect #843
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.
Greetings,
Since about a week, sometimes everyone logging into my server experiences a total game freeze after about 10 seconds in game. The freeze lasts for about a minute, after which they disconnect. I have pinpointed the probable cause to #813 , I can see the same message about https://myip.ipip.net in my server log the moment it hangs (and only then).
The suggested workaround in that issue (disabling my internet) is not possible for me, since there are also other services running on the same node which require the internet. This is also not a real fix.
My suggestion is adding a timeout of say 5 seconds to the connection attempt, this should prevent Minecraft from freezing up. Ideally this connection should of course be done asynchronously, but this quick fix should suffice for now.
This is my first time contributing on GitHub (I normally use GitLab) so please tell me if I need to improve something.
Thank you for considering, have a nice day!