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

wip: Allow retry and timeout settings on the publisher client #239

Closed
wants to merge 4 commits into from

Conversation

cguardia
Copy link
Contributor

This is a feature requested on issue #222. There are a couple of issues to discuss regarding the implementation.

@cguardia cguardia requested a review from a team as a code owner November 16, 2020 09:27
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 16, 2020
@cguardia cguardia added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 16, 2020
@@ -26,6 +26,7 @@
from google.api_core import exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import timeout as timeouts # type: ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a generated file, but I included it in this PR so that it can be seen what the synth changes will do to it.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/python-pubsub API. label Nov 16, 2020
@cguardia
Copy link
Contributor Author

@anguillanneuf coming back to this after a few days absence. I'm not sure if this is the best way to do this. I added the publisher options and updated the docs and client, but to change the actual method definitions, I had to modify the synth code. What is the recommended way to make this kind of change?

@cguardia
Copy link
Contributor Author

@pradn Hi, for issue #222 we decided to have custom retry and timeout settings for the publisher options, and also allow the user to send them on all API calls. This is my first experience with auto-generated code, so I'm not sure I'm doing this right. Please take a look when you can and comment.

@cguardia cguardia requested a review from pradn December 3, 2020 18:45
@anguillanneuf
Copy link
Contributor

Thanks @cguardia for the PR. Setting timeout on the publisher client using publish settings looks right to me. @pradn thoughts?

topic,
data,
ordering_key="",
retry=gapic_v1.method.DEFAULT,
Copy link
Contributor

@pradn pradn Dec 10, 2020

Choose a reason for hiding this comment

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

If retry and timeout are added to PublisherOptions, then there's no need to add these parameters here, yes? The user passes them in using the **attrs, like here:

publisher_options = pubsub_v1.types.PublisherOptions(

Copy link
Contributor

Choose a reason for hiding this comment

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

Somebody might want to override these default options for a few particular publish() calls?

I'd say we keep these two arguments for flexibility, as well as for consistency with other Publisher methods. Besides, the publish() method signature already includes the retry parameter and thus shouldn't be removed, and it makes more sense to retain timeout with it.

@pradn
Copy link
Contributor

pradn commented Dec 10, 2020

The approach of adding timeout to the PublisherOptions looks good to me. You'll have to plumb the timeout down through the sequencers to where the RPC is made.

@meredithslota
Copy link
Contributor

What is the status of this PR? It feels like it's lingering but I'm not sure if it's still a WIP or if it's ready to go. Thanks!

@plamut
Copy link
Contributor

plamut commented Feb 22, 2021

@meredithslota I queried for its status. If nothing else, I can probably take over, as I expect to find some free capacity in the near future.

Update: Discussed with Carlos, I'll take this over and finish whatever still needs to be done (if anything).

@plamut
Copy link
Contributor

plamut commented Feb 26, 2021

Closing in favor of #299.

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 googleapis/python-pubsub API. cla: yes This human has signed the Contributor License Agreement. do not merge Indicates a pull request not ready for merge, due to either quality or timing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants