com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

InvalidOperationException: Collection was modified;

Open zzragida opened this issue 3 years ago • 1 comments

Description

During increase connection client per sec then "InvalidOperationException: Collection was modified;" occured more information on log file

Reproduce Steps

Step1.

  1. clients connect to server (increase 1 client per sec ~ max 100)
  2. clients play automative move, jump, other actions duration (20sec)
  3. clients shutdown end of duration

Step2.

  1. clients connect to server (increase 1 client per sec ~ max 100) : server is not ready
  2. server start
  3. 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

zzragida avatar Aug 30 '22 08:08 zzragida

Backlog MTT-4607

ashwinimurt avatar Sep 09 '22 14:09 ashwinimurt

@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?

NoelStephensUnity avatar Sep 30 '22 01:09 NoelStephensUnity