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

Outbound channel close error is propagated to stream #95

Merged
merged 4 commits into from
Dec 15, 2019

Conversation

marcoferrer
Copy link
Owner

This PR resolves issue #93

@codecov-io
Copy link

codecov-io commented Dec 13, 2019

Codecov Report

Merging #95 into master will increase coverage by 0.91%.
The diff coverage is 85.18%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #95      +/-   ##
============================================
+ Coverage     85.62%   86.53%   +0.91%     
  Complexity       19       19              
============================================
  Files            15       15              
  Lines           306      312       +6     
  Branches         49       53       +4     
============================================
+ Hits            262      270       +8     
  Misses           15       15              
+ Partials         29       27       -2
Impacted Files Coverage Δ Complexity Δ
...oferrer/krotoplus/coroutines/client/ClientCalls.kt 87.17% <ø> (ø) 0 <0> (ø) ⬇️
...utines/call/FlowControlledInboundStreamObserver.kt 82.6% <ø> (+3.44%) 0 <0> (ø) ⬇️
.../marcoferrer/krotoplus/coroutines/call/CallExts.kt 84.84% <83.33%> (-3.04%) 0 <0> (ø)
...rcoferrer/krotoplus/coroutines/call/FlowControl.kt 89.18% <86.66%> (+2.52%) 0 <0> (ø) ⬇️
...s/coroutines/client/ClientResponseStreamChannel.kt 100% <0%> (+14.28%) 9% <0%> (ø) ⬇️

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 9e81e7f...c053690. Read the comment docs.

@marcoferrer
Copy link
Owner Author

I still need to add notes for the reason behind closing outbound channels with an error before cancelling it in the client channel impls. If we close a channel with our server error before cancelling it then we can ensure that any user code that is attempting to send on the outbound channel will throw the server exception. Cancel is just a means to free up the outbound message handler so that our coroutine scope can complete.

I also still need to add tests exercising this use case.
Client Tests: Client Streaming, BidiStreaming
Server Tests: Server Streaming, BidiStreaming

@marcoferrer marcoferrer merged commit dd0a70d into master Dec 15, 2019
@marcoferrer marcoferrer deleted the client-close-bugfix branch December 15, 2019 02:44
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