You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I get the following exception on server side on 'await jsonRpc.Completion' when jsonRpc is disposed just after disposal of marshallable object on client side:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNext()
at StreamJsonRpc.Reflection.RpcTargetInfo.DisposeAsync()
at StreamJsonRpc.JsonRpc.JsonRpcDisconnectedShutdownAsync(JsonRpcDisconnectedEventArgs eventArgs)
I believe the reason is a race condition when accessing the localTargetObjectsToDispose field in the RpcTargetInfo class from different threads. There are other non-concurrent collections in the RpcTargetInfo that probably also need attention.
I created a stress test to reproduce this (attached). It may take a while to get the exception in the server console.
Sometimes I get the following exception on server side on 'await jsonRpc.Completion' when jsonRpc is disposed just after disposal of marshallable object on client side:
I believe the reason is a race condition when accessing the localTargetObjectsToDispose field in the RpcTargetInfo class from different threads. There are other non-concurrent collections in the RpcTargetInfo that probably also need attention.
I created a stress test to reproduce this (attached). It may take a while to get the exception in the server console.
vs-streamjsonrpc-test.zip
The text was updated successfully, but these errors were encountered: