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

PubSub: Propagate RetryError in PublisherClient.publish #7071

Merged
merged 2 commits into from
Jan 11, 2019
Merged

PubSub: Propagate RetryError in PublisherClient.publish #7071

merged 2 commits into from
Jan 11, 2019

Conversation

relud
Copy link
Contributor

@relud relud commented Jan 9, 2019

in google.cloud.pubsub_v1.publisher._batch.thread.Batch self._client.api.publish(self._topic, self._messages) may raise google.api_core.exceptions.RetryError.

if Batch._commit does not catch an error then Batch._futures may never complete.

google.api_core.exceptions.RetryError and google.api_core.exceptions.GoogleAPICallError are the only inheritors of google.api_core.exceptions.GoogleAPIError, so that seemed like the appropriate error to catch.

@relud relud requested a review from crwilcox as a code owner January 9, 2019 00:08
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Jan 9, 2019
@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jan 9, 2019
@relud relud changed the title Handle RetryError from PublisherClient.publish PubSub: Propagate RetryError in PublisherClient.publish Jan 9, 2019
@tseaver tseaver added the api: pubsub Issues related to the Pub/Sub API. label Jan 9, 2019
Copy link
Contributor

@tseaver tseaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like having a new unit test which raises RetryError from publish would be the right way to ensure that we don't regress this fix. Copy the api error test and have the error be a RetryError.

@tseaver
Copy link
Contributor

tseaver commented Jan 11, 2019

@relud Thanks for following up with a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants