-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JsonRpcEventSource.GetArgumentsString may throw exceptions, causing failures while verbose logging #841
Comments
The "Failed to deserialize System.Object value" part of the error doesn't appear in Newtonsoft.Json as far as I can tell. It does appear in messagepack however, so in attempting to repro this, I think we should try the |
In fact, here is more info from the exception thrown:
|
AArnott
added a commit
to AArnott/vs-streamjsonrpc
that referenced
this issue
Sep 9, 2022
AArnott
added a commit
to AArnott/vs-streamjsonrpc
that referenced
this issue
Sep 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As reported in devdiv-1600609, we have errors with this message coming from StreamJsonRpc:
The message itself comes from the
JsonMessageFormatter
:https://github.com/AArnott/vs-streamjsonrpc/blob/39a07107ae2a2fcc0a4846a946b2489fb4197ad1/src/StreamJsonRpc/JsonMessageFormatter.cs#L1036-L1042
and the
MessagePackFormatter
:https://github.com/AArnott/vs-streamjsonrpc/blob/39a07107ae2a2fcc0a4846a946b2489fb4197ad1/src/StreamJsonRpc/MessagePackFormatter.cs#L2460-L2466
This lack of detail (e.g. no argument name nor type hint) makes triaging bug reports very difficult. This lack of detail appears from code inspection to only come from
JsonRpcEventSource.GetArgumentsString
here:vs-streamjsonrpc/src/StreamJsonRpc/JsonRpcEventSource.cs
Line 294 in 39a0710
With a similarly useless but slightly different message coming from a few lines further down:
vs-streamjsonrpc/src/StreamJsonRpc/JsonRpcEventSource.cs
Line 320 in 39a0710
This
GetArgumentsString
is only called from a few places in theJsonRpc
class, all within a check for Verbose logging being enabled. In fact, theGetArgumentsString
method itself is only meant for logging the arguments. But evidently that attempt to represent the arguments as a string fails, and throws an exception, leading to the failure of the overall scenario.We really shouldn't be failing the scenario for sake of failing to log. Let's make logging more resilient!
The text was updated successfully, but these errors were encountered: