Bound the TCP client's connect timeout instead of int.MaxValue - #440
Open
MonoFinity wants to merge 1 commit into
Open
Bound the TCP client's connect timeout instead of int.MaxValue#440MonoFinity wants to merge 1 commit into
MonoFinity wants to merge 1 commit into
Conversation
TCPCommunicationLayer.CreateClient() passed int.MaxValue as VoltRpc's connectionTimeout, i.e. roughly 24 days of retrying. Against an engine process that is already gone the connect loop therefore never terminates, and because a Unity domain reload has to tear the client down, the reload blocks on it - the Editor hangs on "Reloading Domain (busy for HH:MM)" indefinitely instead of reporting a failed connection. Make it a serialized field defaulting to 30000 ms, so a dead engine surfaces as a connection failure and a domain reload can always complete. The range is 1000-600000 ms for anyone who needs a longer wait on a slow cold start. CreateHost() is left alone: it is the listening side rather than a retry loop, and has not been observed blocking a reload. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The problem
TCPCommunicationLayer.CreateClient()passesint.MaxValueas VoltRpc'sconnectionTimeout:That is roughly 24 days of retrying. Against an engine process that is already gone the connect loop never terminates — and because a Unity domain reload has to tear the client down, the reload blocks on it. The symptom is the Editor sitting on
Reloading Domain (busy for HH:MM)indefinitely rather than reporting a failed connection.This is easy to hit in the Editor: any time the engine dies or is reaped (a crash, a stale process from a previous Play session, a port collision), the next domain reload wedges instead of surfacing the real failure. Recovering means killing the Editor.
The change
Make it a serialized field with a 30 s default:
So a dead engine surfaces as a connection failure, and a domain reload can always complete. The range leaves room for anyone who needs a longer wait on a slow cold start.
Why
CreateHost()is left aloneCreateHost()also passesint.MaxValue, twice — but it's the listening side rather than a retry loop, and we've never observed it blocking a reload, so I didn't want to change it speculatively. Happy to bound it here too for symmetry if you'd prefer; just say which value.Notes
master(f49743d).