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 health manager #2609

Merged
merged 1 commit into from
Jul 22, 2020
Merged

Fix health manager #2609

merged 1 commit into from
Jul 22, 2020

Conversation

timebertt
Copy link
Member

How to categorize this PR?

/area quality
/area robustness
/kind bug
/priority normal

What this PR does / why we need it:
The periodic health manager seemed to be unstable under CPU pressure/throttling (e.g. in our CI pipelines https://concourse.ci.gardener.cloud/teams/gardener/pipelines/gardener-master/jobs/master-pull-request-job/builds/17).
While I couldn't get the failing unit tests to break on my machine, it was easy to reproduce while running in a docker container with restricted CPU shares.

This PR makes the health manager(s) more robust for concurrent access by accurately locking access to the managers' state members.

Which issue(s) this PR fixes:
Ref #2532

Special notes for your reviewer:

Release note:

The gardenlet's `/healthz` endpoint has been improved to be more stable under certain circumstances like CPU throttling.

@timebertt timebertt requested a review from a team as a code owner July 21, 2020 14:15
@gardener-robot gardener-robot added area/quality Output qualification (tests, checks, scans, automation in general, etc.) related area/robustness Robustness, reliability, resilience related kind/bug Bug priority/normal labels Jul 21, 2020
@timebertt
Copy link
Member Author

/invite @rfranzke

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

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

/lgtm

Thank you!

})

Describe("#Get", func() {
It("should get the correct status (true)", func() {
d.health = true
Expect(d.health).To(BeTrue())
Expect(d.Get()).To(BeTrue())
Copy link
Member

Choose a reason for hiding this comment

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

... thanks :)

Copy link
Member

@vpnachev vpnachev left a comment

Choose a reason for hiding this comment

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

/lgtm

I am just curious why sometimes .health is used, and sometimes .Get() in the tests?

@rfranzke
Copy link
Member

@vpnachev In the tests for the Get() function the Get() function is now used correctly. In all other tests the .health is read directly to decouple these tests from Get() so that they don't fail in case Get() has a bug.

I think we can go ahead with the /merge.

@rfranzke rfranzke merged commit cfcbbcf into gardener:master Jul 22, 2020
@timebertt timebertt deleted the fix/healthz branch July 22, 2020 05:50
@gardener-robot gardener-robot added priority/3 Priority (lower number equals higher priority) and removed priority/3 Priority (lower number equals higher priority) labels Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/quality Output qualification (tests, checks, scans, automation in general, etc.) related area/robustness Robustness, reliability, resilience related kind/bug Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants