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

Fix client connection leak on non-failure, non-interruption cases #648

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

ghostdogpr
Copy link
Contributor

@ghostdogpr ghostdogpr commented Jul 17, 2024

When using client streaming, if the stream is ended because of .take, .runHead or even .interruptWhen, the exit value in anyExitHandler is Success, not a failure or an interruption. In that case the underlying connection is not cancelled and could stay there forever.

As a fix, I moved the check of isSuccess to the method used for non-streaming cases, and in streaming cases we will always call cancel.

@thesamet thesamet merged commit aa3e67e into scalapb:master Jul 17, 2024
5 checks passed
@ghostdogpr ghostdogpr deleted the client-cancellation branch July 17, 2024 04:59
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