-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
PubSub: dispatch_callback errors after cancel() of a subscription #6130
Comments
@theacodes I'm not sure how cancellation should work. Can you clairify? |
Cancellation tries to be as "fast" as possible, as waiting for all currently held messages to resolve is basically the halting problem. We should probably update the docs there to mention that. More serious is the fact that there doesn't seem to be a "clean" shutdown here. I'm going to assign over to @crwilcox to handle, but really the fix should be straightforward (be more defensive when trying to invoke things on the streaming pull manager that could be in the process of shutting down) |
@theacodes, @crwilcox Should this be categorized as a bug, then? |
@plamut, can you please take a look at this? |
The first manifestation of the issue (stacktrace 1) is the issue #5751, which has been fixed and released. However, I was able to reproduce the second issue (stacktrace 2) even with the latest PubSub version ( It appears that some extra checks need to be added when interacting with the streaming pull manager, because the latter could be in the process of shutting down (as @theacodes already mentioned). Working on a fix. Update: Fixed, opened a PR. |
OS: Linux 4.17.0-3rodete2-amd64, Debian 4.17.17-1rodete2
Python 2.7.13
google-cloud-pubsub 0.35.4
Stacktrace 1
Stacktrace 2
Steps to reproduce
This subscription should be canceled approximately after the first message. In my test there are two messages sent to the topic and
event.set()
is called after the second.I realize that calling cancel() so soon prevents the ack from being sent. Is there a cleaner way to stop the subscription?
The text was updated successfully, but these errors were encountered: