fix: Shut down NetworkManager when reloading the domain#4068
Open
simon-lemay-unity wants to merge 2 commits into
Open
fix: Shut down NetworkManager when reloading the domain#4068simon-lemay-unity wants to merge 2 commits into
NetworkManager when reloading the domain#4068simon-lemay-unity wants to merge 2 commits into
Conversation
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.
Purpose of this PR
When the domain is reloaded while in play mode, a lot (most?) of the state in
NetworkManageris lost because it's not serializable. This state gets lost without any opportunity to properly clean it up which results in memory leaks and sockets not being closed. (The last one is particularly problematic because the zombie sockets will cause issues as long as the editor is open.)While ideally NGO would serialize all of its state and survive domain reloads, that's probably not very realistic in the short term as that would require extensive changes to the code. What we can do relatively easily however is properly shut down the
NetworkManagerwhen we do detect a domain reload. This at least avoids leaking resources.Jira ticket
UUM-146443
Changelog
NetworkManagerwill now perform a proper shutdown when the domain is reloaded in play mode, instead of being left in some half-initialized state that leaks memory and socket handles.Documentation
Testing & QA
Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?Backports
Probably not worth it.