-
Notifications
You must be signed in to change notification settings - Fork 450
fix: cleaning up connected clients upon shutdown [MTT-1573] #1945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changelog entry & tests?
also potentially backport to release/1.0.0 since it's not a breaking change?
I'll have to push back a bit here. A changelog entry would be pretty useless. When this issue was raised, client list would contain old information. Only improvement is internal data structure being cleaner and less error prone. Do we really want to changelog "Improved internal data handling" ? Tests. Our current multi instance testing classes deal with hosting and joining, it would be cumbersome to test around this, and there wouldn't be much value anyway. I'd rather trust the code, after inspection and debugging through (which I did) than layer more test complexity. For backport, certainly. As soon as this one is merged in, I'll add another backport PR. |
@@ -1301,6 +1306,8 @@ internal void ShutdownInternal() | |||
IsListening = false; | |||
m_ShuttingDown = false; | |||
m_StopProcessingMessages = false; | |||
|
|||
ClearClients(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to answer your question, I'd like to ask a question here. wouldn't this change behavior such that connectedclients list(s) would be empty after stophost/client/server (aka shutdown) instead of (previously) containing stale data until we call Initialize() again?
I think that's the fix we're going for here with the JIRA ticket & this PR.
so, a changelog entry saying something like, "cleanup client lists on stophost/client/server" would be useful to know I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. done.
This cleans up the connected clients upon shutdown. Proper clean-up.
Doesn't change much for the customers, though, since recent Netcode for GameObjects would throw an exception, anyway, if trying to access connected clients while not hosting.
#416