Skip to content

fix: Clear adapter send queues on client disconnection #1649

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

Merged
merged 7 commits into from
Feb 10, 2022

Conversation

simon-lemay-unity
Copy link
Contributor

Likeliest cause of MTT-2329.

When the server disconnected a client, it would clear the send queues related to that client. But the reverse was not done. When the client disconnected from the server, it would not clear its send queues. If there was data in there, the adapter would attempt to send it on its next update (or if properly shut down, it would try to send it the next time a connection was made using the same client ID).

The fix is simply to apply the same logic when client disconnects as when server disconnects.

Changelog

com.unity.netcode.adapter.utp

  • Fixed: Fixed issue where disconnecting from the server with data still in the queue would result in an error message about a stale connection.

Testing and Documentation

  • Includes integration tests.
  • No documentation changes or additions were necessary.

@NoelStephensUnity
Copy link
Collaborator

NoelStephensUnity commented Feb 5, 2022

@simon-lemay-unity Take a look at #1653, I think some develop transport PRs didn't make it into the v1.0.0 branch, but I did have better success with some of the modifications I made up to the point I realized all of those tests are #IF'd out in develop with a todo note about getting them working on consoles. It is the same timing issue come back to haunt you! :)

@simon-lemay-unity
Copy link
Contributor Author

@simon-lemay-unity Take a look at #1653, I think some develop transport PRs didn't make it into the v1.0.0 branch, but I did have better success with some of the modifications I made up to the point I realized all of those tests are #IF'd out in develop with a todo note about getting them working on consoles. It is the same timing issue come back to haunt you! :)

Yeah, I may have not been as diligent backporting PRs when they only impacted tests. Thanks for bringing the changes in 1.1.0.

Regarding the tests being defined out for consoles, the reason is that at the time we didn't run UTP tests on these platforms. It was deemed a bit useless to investigate adapter test failures when we didn't even know if UTP itself was working correctly on consoles. Now that we know it does, we can get back to enabling these tests and investigating the failures (it's a task in our current sprint).

simon-lemay-unity added a commit that referenced this pull request Feb 10, 2022
simon-lemay-unity added a commit that referenced this pull request Feb 10, 2022
NoelStephensUnity pushed a commit that referenced this pull request Feb 10, 2022
* Bring over some changes from PR #1649

* Add test for server disconnect after client disconnect

* Improve stability of connection tests

* Fix handling of Disconnect events

* Add CHANGELOG entry

* Add PR number to CHANGELOG entry
@NoelStephensUnity NoelStephensUnity merged commit e3ace4e into develop Feb 10, 2022
@NoelStephensUnity NoelStephensUnity deleted the fix/clear-send-queue-client-disconnect branch February 10, 2022 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants