The StreamJsonRpc library offers JSON-RPC 2.0 over any .NET Stream, WebSocket, or Pipe. With bonus support for request cancellation, client proxy generation, and more.
Other
730
stars
149
forks
source link
SystemTextJsonFormatter throws exceptions when ETW logging is enabled #1038
When validating the changes in VS, I hit a huge number of exception count regressions (thousands in some scenarios), see this internal link. These regressions were not reproducible in my changes locally, nor in the build from the VS insertion, until I either
set the env var StreamJsonRpc_TestWithEventSource
or ran VS under perfview using the streamjsonrpc ETW provider (F0CFFE53-BCC5-53F5-8873-995568808A3B)
The exception stacks in the RPS run pretty much all look like the following:
I've been working on converting the Roslyn LSP server to STJ in https://github.com/dotnet/roslyn/pull/73207
When validating the changes in VS, I hit a huge number of exception count regressions (thousands in some scenarios), see this internal link. These regressions were not reproducible in my changes locally, nor in the build from the VS insertion, until I either
StreamJsonRpc_TestWithEventSource
The exception stacks in the RPS run pretty much all look like the following:![image](https://github.com/microsoft/vs-streamjsonrpc/assets/5749229/0a8b3f06-3149-408d-81d6-459fb6e38d48)
It appears as though we're hitting this throw in
TryGetArgumentByNameOrIndex
- https://github.com/microsoft/vs-streamjsonrpc/blob/f6a3b480bc02f79d73eac256ae3768f51146225a/src/StreamJsonRpc/SystemTextJsonFormatter.cs#L532 because the JsonRpcEventSource is calling to get a string representation of the message withname: null
and whereJsonArguments
isJsonValueKind.Object
- https://github.com/microsoft/vs-streamjsonrpc/blob/f6a3b480bc02f79d73eac256ae3768f51146225a/src/StreamJsonRpc/JsonRpcEventSource.cs#L297