microsoft / microsoft/vs-streamjsonrpc

Confusingly named ConnectionLostException thrown on client when client RPC instance is disposed prematurely

Open
#767 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
937
Forks
178
Avg merge
3d 1h
Merged PRs (30d)
28

Description

Repro:

  1. Create JsonRpc instance, e.g.: perhaps via brokered service, servicehub service.
  2. Invoke long running request
  3. Dispose RPC instance

Expected:
Clear indication of what the client is doing wrong, such as ObjectDisposedException or message indicating that the client RPC instance was disposed.

Actual:
ConnectionLostException is thrown on the invocation Task. While this matches the documented behavior, it's initially unclear that the client is doing something wrong and it is not the server crashing or forcibly ending the session. As a result I spent a lot of time digging through irrelevant server logs trying to figure out the source of the crash.

Recommendations:
It seems like there would be benefit to having a way to differentiate between client-severed-connection and server-severed-connection, especially in fault telemetry.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by tracing where ConnectionLostException is produced after a client RPC instance is disposed and how the invocation Task reports it. Define and test a distinction between client-disposed and server-severed connections, including the fault telemetry or message expected for each case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.