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: deprecate maxExtension in favour of maxExtensionMinutes #1402

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

feywind
Copy link
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 as code owners 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
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
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.

@@ -182,10 +185,19 @@ export class LeaseManager extends EventEmitter {
* @private
*/
setOptions(options: FlowControlOptions): void {
// Convert the old deprecated maxExtension to avoid breaking clients.
if (
options.maxExtension !== undefined &&
Copy link
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
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.

@feywind feywind merged commit 46b83ba into googleapis:main Sep 27, 2021
@feywind feywind deleted the max-extension-minutes branch September 27, 2021 17:24
gcf-merge-on-green bot pushed a commit that referenced this pull request Sep 27, 2021
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/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