- Notifications
You must be signed in to change notification settings - Fork1.6k
PubSub: Fix pubsub Streaming Pull shutdown on RetryError#7863
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
If a RetryError occurs, it is time to stop waiting for the underlyinggRPC channel to recover from a transient failure, and a clean shutdownneeds to be triggered.This commit assures that this indeed happens (it used to happen onterminal channel errors only).
tseaver approved these changesMay 7, 2019
ContributorAuthor
plamut commentedMay 7, 2019
As discussed offline, the failingreCAPTCHA Enterprise build is not related, and we agreed to merge this. |
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
api: pubsubIssues related to the Pub/Sub API. cla: yesThis human has signed the Contributor License Agreement.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
Closes#7709.
If a gRPC channel is in
TRANSIENT_FAILUREstate for too long, the retry timeout configured insubscriber client config kicks in, and aRetryErroris raised in a background thread, but the client keeps running, and the error is not propagated to the top level code.This PR makes sure that the following happens:
future.result(), allowing the user code a chance to catch the error and react to it.How to test
I was not able to reproduce the actual error users reported in a real setup (a sample pubsub app deployed to K8s), but figured out what isprobably happening and faked the error.
Steps to reproduce:
grpcdependency in your local Python environment, example:total_timeout_millissetting insubscriber client config to 10 (seconds... in order to not wait for too long)Actual result (before the fix):
A
RetryErroroccurs in the background after ~10 seconds, some of the threads exit, but the subscriber client keeps running, and the error isnot propagated to the main thread (the future returned by thesubscribe()method is not resolved)Expected result (after the fix):
Everything gets shut down cleanly, and
RetryErroris propagated to and raised in the main code.