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: shutdown error on streaming pull callback error #40

Merged
merged 2 commits into from Feb 28, 2020

Conversation

plamut
Copy link
Contributor

@plamut plamut commented Feb 28, 2020

Fixes #39.

This PR fixes an error that can happen if cancelling a streaming pull future when the streaming pull manager has already been shut down due to the error in the user callback.

How to test

  • Have a topic and a subscription, publish at least one message to the topic.
  • Take the basic streaming pull sample from the docs.
  • Adjust the message received callback to raise an exception

Actual result (before the fix):
An error occurs during the shutdown:

RuntimeError: set_result can only be called once.

Expected result (after the fix):
No internal error occurs during the shutdown, except for the error from the user callback, as expected.

PR checklist

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@plamut plamut requested a review from pradn February 28, 2020 14:47
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 28, 2020
@plamut plamut requested a review from pradn February 28, 2020 16:01
@pradn pradn merged commit 552539e into googleapis:master Feb 28, 2020
@plamut plamut deleted the iss-39 branch February 28, 2020 16:22
gcf-merge-on-green bot pushed a commit that referenced this pull request Feb 28, 2020
🤖 I have created a release \*beep\* \*boop\* 
---
### [1.3.1](https://www.github.com/googleapis/python-pubsub/compare/v1.3.0...v1.3.1) (2020-02-28)


### Bug Fixes

* shutdown error on streaming pull callback error ([#40](https://www.github.com/googleapis/python-pubsub/issues/40)) ([552539e](https://www.github.com/googleapis/python-pubsub/commit/552539e7beb30833c39dd29bfcb0183a07895f97))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RunTime error occurs when shutting down the streaming pull manager on user callback exception
3 participants