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: expose a max_duration_per_lease_extension setting for subscribers #35

Closed
hongalex opened this issue Feb 20, 2020 · 5 comments · Fixed by #38
Closed

pubsub: expose a max_duration_per_lease_extension setting for subscribers #35

hongalex opened this issue Feb 20, 2020 · 5 comments · Fixed by #38
Assignees
Labels
api: pubsub Issues related to the googleapis/python-pubsub API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@hongalex
Copy link
Member

hongalex commented Feb 20, 2020

For languages that support lease management, we have bound the percentile distribution to 10s - 10m. It would be useful if the upper bound were configurable.

A user might process messages very slowly (8m to ack)
If the application fails 5s after receiving a message (whose ack deadline was set to 8m, because that's the deadline the percentile distribution gave), the user has to wait 7m55s for the message to be redelivered
Users should be able to set max_duration_per_lease_extension = 20s, which caps an individual modAck RPC to 20s. This would have the downside of causing more modack RPCs to be sent, but the upside that the redelivery time would only be 15s
This setting differs from max_lease_duration, which defines the total amount of time we'll hold a message.

In addition, max_duration_per_lease_extension should be disabled if <=0, and should default to 0.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/python-pubsub API. label Feb 20, 2020
@busunkim96 busunkim96 added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Feb 21, 2020
@IlyaFaer
Copy link

@pradn, that was me, who did this for Go, and, if you don't mind, I'll do this for Python as well

@pradn
Copy link
Contributor

pradn commented Feb 21, 2020

@IlyaFaer Sounds good, Ilya. Reach out if you have any questions.

@IlyaFaer
Copy link

IlyaFaer commented Feb 25, 2020

@pradn, yes, I'm taking a look at ack_deadline() property and I don't see where _last_histogram_size value is changed. This attribute represents the size of the histogram on the last ack_deadline call, right?

I found only two places, where it's used:


target = min([self._last_histogram_size * 2, self._last_histogram_size + 100])

Am I missing something, or target in here will always be equal to 100? Looks like something that needs to be fixed (I think, I'll push it by the way)

@hongalex hongalex changed the title pubsub: expose a max_extension_period setting for subscribers pubsub: expose a max_duration_per_lease_extension setting for subscribers Feb 28, 2020
@hongalex
Copy link
Member Author

Hey @IlyaFaer, we finalized the naming for all languages and updated the original issue. Please update when you get the chance.

@IlyaFaer
Copy link

IlyaFaer commented Mar 2, 2020

@hongalex, @pradn, okay, it's done

@pradn pradn closed this as completed in #38 Mar 3, 2020
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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants