Skip to content
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

Document by test the exceptions thrown in disconnect scenarios #538

Merged
merged 4 commits into from
Sep 2, 2020

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Sep 2, 2020

This PR adds tests to demonstrate which exception types are thrown in various disconnect scenarios.
It also improves documentation of these exceptions.

Closes #246

Everything checks out, but this resolves a concern brought up in microsoft#246
- `ConnectionLostException` is thrown when the connection drops (due to local Dispose call) on a pending outbound call.
- `OperationCanceledException` is thrown in the prior scenario but when the outbound call's `CancellationToken` is signaled.
- An RPC server in an callback will itself experience `OperationCanceledException` instead of `ConnectionLostException` if the client disconnects.
@AArnott AArnott added this to the v2.6 milestone Sep 2, 2020
@AArnott AArnott requested review from tmat and milopezc September 2, 2020 22:02
@AArnott AArnott self-assigned this Sep 2, 2020
@AArnott AArnott changed the title Document, test and fix up exceptions in disconnect scenarios Document by test the exceptions thrown in disconnect scenarios Sep 2, 2020
@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2020

Codecov Report

Merging #538 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #538      +/-   ##
==========================================
- Coverage   89.76%   89.72%   -0.05%     
==========================================
  Files          53       53              
  Lines        4408     4408              
==========================================
- Hits         3957     3955       -2     
- Misses        451      453       +2     
Impacted Files Coverage Δ
src/StreamJsonRpc/JsonRpc.cs 92.48% <ø> (-0.32%) ⬇️
src/StreamJsonRpc/MessageHandlerBase.cs 100.00% <0.00%> (+1.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2579f9...a33be09. Read the comment docs.

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.

Stabilize Dispose patterns
2 participants