Skip to content

Comments

Add health start interval#40894

Merged
neersighted merged 1 commit intomoby:masterfrom
cpuguy83:health_start_interval
Jul 6, 2023
Merged

Add health start interval#40894
neersighted merged 1 commit intomoby:masterfrom
cpuguy83:health_start_interval

Conversation

@cpuguy83
Copy link
Member

@cpuguy83 cpuguy83 commented May 2, 2020

This adds an additional interval to be used by healthchecks during the
start period.
Typically when a container is just starting you want to check if it is
ready more quickly than a typical healthcheck might run. Without this
users have to balance between running healthchecks to frequently vs
taking a very long time to mark a container as healthy for the first
time.

Replaces #33918
Closes #33410

@cpuguy83 cpuguy83 added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/1-design-review labels May 2, 2020
@cpuguy83
Copy link
Member Author

cpuguy83 commented May 2, 2020

A note about this:

Currently if a start interval is not specified, it will get the default start interval of 30s... which is the same as the normal interval.
This means, as currently coded, every healthcheck will have this start interval even for pre-existing containers.

@cpuguy83
Copy link
Member Author

cpuguy83 commented May 2, 2020

I'll also note:

The only real interest I have in this PR is:

  1. People have been asking for (something like) this
  2. The other PR was the oldest open PR in the repo

One concern I have for this is the fact that healthcheck configs are in the container Config portion, which gets committed as part of the image config... which means changing this changes the image spec.... technically these healthceck configs aren't even in the OCI spec anyway, though.

@bpascard
Copy link
Contributor

bpascard commented May 6, 2021

First I'd like to say @cpuguy83 rules.

Second are there are any updates on this PR? Any chance for this to be merged in its current form?

@iraklisg
Copy link

iraklisg commented Apr 3, 2022

Is there any update about this PR? Thank you

@thaJeztah thaJeztah added this to the 22.04.0 milestone Apr 7, 2022
@thaJeztah
Copy link
Member

@dperny can you check if this requires changes on the SwarmKit side to allow this to be used?

@aaccioly
Copy link

Hey. Is this PR full being considered?

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

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

Seems OK to me ❤️

I'd love to have @corhere take a look if you've got some time?
(I seem to recall you've looked at the health checks implementation recently? 👀 😇)

@tianon
Copy link
Member

tianon commented Jun 1, 2022

(Needs a rebase, but it appears to be pretty superficial -- just markdown and yaml, so implementation probably doesn't need to change for that 👀)

@thaJeztah thaJeztah force-pushed the health_start_interval branch from 9816d6c to a71a096 Compare June 2, 2022 20:33
@thaJeztah
Copy link
Member

I did a quick rebase, and added a second commit with some changes I wanted to suggest; @cpuguy83 PTAL if that last commit looks sane to your (if so I can squash)

Copy link
Contributor

@corhere corhere left a comment

Choose a reason for hiding this comment

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

The logic for selecting between startInterval and probeInterval is inconsistent with the behavior described by the Swagger docs and with how handleProbeResult decides when to start incrementing the failure streak. Which is the intended behavior?

vincentbernat added a commit to akvorado/akvorado that referenced this pull request Jul 30, 2022
This is useless as this is not an initial delay. We need this
[PR](moby/moby#40894), which may land soon...
@thaJeztah thaJeztah modified the milestones: 22.06.0, v-next Aug 18, 2022
daniharo added a commit to daniharo/mordente that referenced this pull request Oct 24, 2022
@bpascard
Copy link
Contributor

Can we expect this PR to land in 22.06 ?

@cpuguy83
Copy link
Member Author

@bpascard Nope.

@bpascard
Copy link
Contributor

bpascard commented Dec 6, 2022

Any chances this PR lands in 23.0 ?

@corhere
Copy link
Contributor

corhere commented Dec 6, 2022

@bpascard Nope. 23.0 is the new name for the release formerly known as 22.06.

@neersighted
Copy link
Member

@cpuguy83 will you have time to rebase and address reviews on this one soon?

@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 5, 2023

😭 Windows

'count' is not recognized as an internal or external command

I don't blame Windows too much here, though, since its some custom busybox on Windows.

This adds an additional interval to be used by healthchecks during the
start period.
Typically when a container is just starting you want to check if it is
ready more quickly than a typical healthcheck might run. Without this
users have to balance between running healthchecks to frequently vs
taking a very long time to mark a container as healthy for the first
time.

Signed-off-by: Brian Goff <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@cpuguy83 cpuguy83 force-pushed the health_start_interval branch from d7fba45 to 2216d3c Compare July 5, 2023 23:44
@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 6, 2023

Updated this to skip the new test on Windows.

@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 6, 2023

All green now.

@neersighted neersighted merged commit e4c866f into moby:master Jul 6, 2023
@cpuguy83 cpuguy83 deleted the health_start_interval branch July 6, 2023 18:44
@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 6, 2023

Swarmkit PR: moby/swarmkit#3142
CLI PR: docker/cli#4405
Compose Spec: compose-spec/compose-spec#383
Dockerfile: moby/buildkit#3998

@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 6, 2023

Created a tracking issue for all the other changes that need to be completed before the 25.0 release: #45897

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

Labels

impact/api impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/4-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Perform first healthcheck on startup without waiting the specified interval

9 participants