com.unity.netcode.gameobjects
com.unity.netcode.gameobjects copied to clipboard
InvalidOperationException: Collection was modified;
Description
During increase connection client per sec then "InvalidOperationException: Collection was modified;" occured more information on log file
Reproduce Steps
Step1.
- clients connect to server (increase 1 client per sec ~ max 100)
- clients play automative move, jump, other actions duration (20sec)
- clients shutdown end of duration
Step2.
- clients connect to server (increase 1 client per sec ~ max 100) : server is not ready
- server start
- crash before almost 5 clients connected
Actual Outcome
A clear and concise description of what happened and broke.
Expected Outcome
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
- OS: Ubuntu 20.04 LTS (WSL)
- Unity Version: Unity 2021.3.7f1
- Netcode Version: 1.0.1
- Netcode Commit:
Additional Context
Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the issue. server-20220830174400.log
Backlog MTT-4607
@zzragida I was looking at the log file and I think I see where the issue resides. It appears you might need to adjust your UnityTransport buffer sizes with that many clients connecting and disconnecting.
This was the suspect error I was seeing:
Closing connection 46 as reliability guarantees can't be maintained. Perhaps 'Max Send Queue Size' (10240) is too small for workload.
We do have an update to the UnityTransport that should be in the next update where it will dynamically size the send queue buffer size as needed.
With v1.0.2 if your buffers aren't large enough then you can get truncated or even dropped messages that can cause issues in various areas depending upon each scenario.
What are your current UnityTransport buffer sizes?