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

LifeTimeWatcher SleepDuration calculation testing #17919

Merged
merged 18 commits into from
Feb 14, 2023

Conversation

Freyert
Copy link
Contributor

@Freyert Freyert commented Nov 13, 2022

One component that makes fixing #16439 difficult is the complexity of the doRenewWithOptions function.

Modifying the sleep duration calculation function is a critical aspect of #16439. We need to ensure that if we change the sleep duration calculating to include the Age-Header the invariant "sleep duration is less than remaining lease duration" holds true. (see #16439 (comment))

I purposely don't use the full calculation in the test because that may be prone to modification in the future, but in all cases the sleep duration should be less than the remaining lease duration.

Copy link
Contributor

@peteski22 peteski22 left a comment

Choose a reason for hiding this comment

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

@Freyert, thanks so much for submitting this, apologies it's taken a while to get anyone in front of it. I added a few comments, if you could take a look it would be greatly appreciated.

api/lifetime_watcher.go Outdated Show resolved Hide resolved
api/lifetime_watcher.go Outdated Show resolved Hide resolved
api/renewer_test.go Outdated Show resolved Hide resolved
api/renewer_test.go Outdated Show resolved Hide resolved
api/renewer_test.go Outdated Show resolved Hide resolved
api/renewer_test.go Outdated Show resolved Hide resolved
api/lifetime_watcher.go Outdated Show resolved Hide resolved
changelog/16439.txt Outdated Show resolved Hide resolved
@peteski22
Copy link
Contributor

I'm going to commit my suggestions so this can be merged, as we aren't working/looking at this now. Apologies if you didn't get time to review them yet.

@peteski22 peteski22 enabled auto-merge (squash) February 14, 2023 14:02
@peteski22 peteski22 self-requested a review February 14, 2023 14:56
@peteski22 peteski22 merged commit 86258cd into hashicorp:main Feb 14, 2023
@Freyert Freyert deleted the sleep-calc branch February 15, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants