Skip to content

Fix connection hang upon failure to deserialize result values - #1175

Merged
Andrew Arnott (AArnott) merged 1 commit into
mainfrom
dev/andarno/fixhang
Mar 31, 2025
Merged

Andrew Arnott (AArnott) merged 1 commit into
mainfrom
dev/andarno/fixhang

Conversation

@AArnott

Copy link
Copy Markdown
Member

When a formatter throws an exception from SetExpectedDataType, the exception was being swallowed, and the request just dangled at the client without ever completing. With this fix, it completes with the exception. Since being unable to serialize a result is a fatal exception, this leads to the connection dying. This is preferable to a hang, and the exception is captured as the cause of the disconnect for later analysis.

There is no test because the existing formatters don't throw in this code path. A new formatter might (like the one we're creating for Nerdbank.MessagePack).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants