Could it be that it needs to send 2k ghosted entities and it is using GhostRelevancy?
(this does not happen if the Build configuration is Debug or Develop)
I suspect this is caused by too many irrelevant ghosts causing snapshots to be larger than one MTU and require fragmentation because we despawn all of them at once.
There is a bug with fragmentation pipeline initialization in NetworkStreamReceiveSystem - if you change line ~114 (in CreateServerDriver) to driver = NetworkDriver.Create(reliabilityParams, fragmentationParams); that might be enough to fix it. You can also create a custom INetworkStreamDriverConstructor and assign it to NetworkStreamReceiveSystem.s_DriverConstructor during bootstrap if you want to tweak the pipeline parameters without modifying the package.
I can now run in release mode and the initial error no longer occurs (woo!)
BUT…
I am in NavigationScene and hit “host game” (this bootstraps client/server worlds then triggers MainScene)
MainScene now loads and works! (nice!)
I hit “quit” to return to NavigationScene
If I hit “host game” again it will will crash with “Fragmentation capacity exceeded”
I get an error:
System.InvalidOperationException: Fragmentation capacity exceeded
Thrown from job: Unity.Networking.Transport.FragmentationPipelineStage.Receive
This Exception was thrown from a job compiled with Burst, which has limited exception support. Turn off burst (Jobs -> Burst -> Enable Compilation) to inspect full exceptions & stacktraces. In this standalone build configuration burst will now abort the Application.
(Filename: Line: 408)
So it seems to only work once.
This is odd because I totally destroy all of ECS when returning to NavigationScene (Worlds.Dispose and UniversalQuery delete all entities)
So I wonder why this error is stateful.