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: Update default settings; add maximum total lease extension #3920

Merged
merged 2 commits into from
Dec 18, 2019

Conversation

chrisdunelm
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 17, 2019
Copy link
Collaborator

@jskeet jskeet left a comment

Choose a reason for hiding this comment

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

A few niggles, but generally fine.

@@ -207,10 +218,15 @@ internal void Validate()
public static TimeSpan MinimumAckExtensionWindow { get; } = TimeSpan.FromMilliseconds(50);

/// <summary>
/// The default message ACKnowlegdment extension window of 15 seconds.
/// The default message ACKnowlegdement extension window of 15 seconds.
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's still a typo here - gd instead of dg

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, thanks. Done!

}
}
}));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the method return at this point? Presumably it's just about feasible for _maxExtensionDuration to be one tick, so it could be disposed by the end of the block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the code here is setting up the max lease-extension deadline, so at this point it is correct to continue with sending the extension request to the server, and scheduling a further extension.
Comments added to clarify.

{
cts2 = _cts;
}
cts2?.Cancel();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this dispose as well? I'm a little lost as to what this is all doing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

(Comments on this and Dispose would be useful.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Reading through everything else, it looks like it doesn't have to be disposed, but I suspect it would be good to do so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Various comments added to try to clarify how this works.

{
// Ids have been added to _extendQueue, so trigger a push.
_eventPush.Set();
// Some ids still exist, schedule another extension.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly edit this comment to add "with the same deadline for how long the lease can be extended"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@chrisdunelm chrisdunelm merged commit e13ab00 into googleapis:master Dec 18, 2019
@chrisdunelm chrisdunelm deleted the defaults branch December 18, 2019 09:10
@chrisdunelm chrisdunelm mentioned this pull request Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants