Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

fix: deprecate maxExtension in favour of maxExtensionMinutes#1402

Merged
feywind merged 3 commits intogoogleapis:mainfrom
feywind:max-extension-minutes
Sep 27, 2021
Merged

fix: deprecate maxExtension in favour of maxExtensionMinutes#1402
feywind merged 3 commits intogoogleapis:mainfrom
feywind:max-extension-minutes

Conversation

@feywind
Copy link
Copy Markdown
Collaborator

@feywind feywind commented Sep 24, 2021

Background: maxExtension was incorrectly interpreted as seconds in the LeaseManager. This means that if users were relying on client side lease extension in subscribers, they would not actually extend leases for 60 minutes, but only 60 seconds. Also if the user passed in values, they'd be interpreted incorrectly. This PR deprecates the old field in favour of a new one that's explicitly named like the defaults, but also converts the old value if needed.

Fixes: #1208

Background: maxExtension was incorrectly interpreted as seconds in the LeaseManager. This means that if users were relying on client side lease extension in subscribers, they would not actually extend leases for 60 minutes, but only 60 seconds. Also if the user passed in values, they'd be interpreted incorrectly. This PR deprecates the old field in favour of a new one that's explicitly named like the defaults, but also converts the old value if needed.
@feywind feywind requested review from a team September 24, 2021 18:18
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 24, 2021
@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the googleapis/nodejs-pubsub API. label Sep 24, 2021
@feywind feywind added owlbot:run Add this label to trigger the Owlbot post processor. and removed api: pubsub Issues related to the googleapis/nodejs-pubsub API. labels Sep 24, 2021
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 24, 2021
Copy link
Copy Markdown
Contributor

@anguillanneuf anguillanneuf left a comment

Choose a reason for hiding this comment

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

LGTM. Looks like the Node.js sample just uses maxMessages. Can you think of any other places we need to update?

@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the googleapis/nodejs-pubsub API. label Sep 25, 2021
Copy link
Copy Markdown
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

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

LGTM with nit.

Comment thread src/lease-manager.ts
setOptions(options: FlowControlOptions): void {
// Convert the old deprecated maxExtension to avoid breaking clients.
if (
options.maxExtension !== undefined &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happens if both are defined?

@feywind feywind added the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 27, 2021
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 27, 2021
@feywind feywind added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 27, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 27, 2021
@feywind
Copy link
Copy Markdown
Collaborator Author

feywind commented Sep 27, 2021

LGTM. Looks like the Node.js sample just uses maxMessages. Can you think of any other places we need to update?

I think this is maxMessages rather than maxExtension, should be unchanged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: pubsub Issues related to the googleapis/nodejs-pubsub API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default option maxExtensionMinutes is treated as seconds

4 participants