Perform first healthcheck on startup without waiting the specified interval#33918
Perform first healthcheck on startup without waiting the specified interval#33918yongtang wants to merge 1 commit intomoby:masterfrom
Conversation
There was a problem hiding this comment.
Looks like the indentation is not consistent here.
There was a problem hiding this comment.
@aaronlehmann Thanks. The PR has been updated.
daemon/health.go
Outdated
There was a problem hiding this comment.
It's a bit weird that you have to set StartPeriod to a negative value to get the health check to run at startup. I would expect it to do this when StartPeriod is 0. I know there are backward compatibility issues, though.
There was a problem hiding this comment.
Perhaps it would be clearer to introduce a new boolean flag for this, instead of overloading StartPeriod with a magic value.
There was a problem hiding this comment.
Thanks @aaronlehmann. The PR has been updated with a flag --nowait (True/False) to cover the scenario. Please take a look.
|
ping @yongtang |
85a199a to
f6cc72d
Compare
f6cc72d to
d23ea2d
Compare
|
@aaronlehmann The PR has been updated. Please take a look and let me know if there are any issues. |
|
Thanks, I like this design a lot more. The naming seems fine to me, but others can feel free to comment if they think of a flag name they prefer to Design LGTM |
builder/dockerfile/dispatchers.go
Outdated
There was a problem hiding this comment.
Didn't realize this wasn't hyphenated. Wouldn't no-wait be more consistent with the other flags?
…terval This fix tries to address the issue raised in moby#33410 where the first healthcheck was only performed after the specified interval. That might be problematic in case the interval is long yet, as is specified in moby#33410. This fix make the following changes: 1. The first healthcheck is performed on startup (at time 0) 2. The first healthcheck is only valid when no-wait = true The changes allows the backward-compatibility while at the same time it is possbile to address the issue raised in moby#33410. Additional test cases have been added. This fix fixes moby#33410. Signed-off-by: Yong Tang <[email protected]>
d23ea2d to
13a19b8
Compare
|
Thanks @aaronlehmann for the review. The PR has been updated with |
|
I wonder if we can just have a whole separate configuration for the startup protocol. |
|
What do you think about merging this as a good solution? #33918 (comment) could be another issue. |
|
@rdxmb The problem is I don't believe this is a good solution. It may be a solution that works for some case that you currently have but that does not make it a good one. |
|
I am with @cpuguy83 on this one. I also have a bunch of containers that need a second or so before they are fully running. They should be able to go into healthy state within seconds, but there is no way to make that happen without setting a short check interval. This pull request still would not fix that. Ideal solution in my case would be if a health check would happen right after the start-period. Then, I can choose a a start period of, say, 5 seconds and a check interval of 5 minutes and still have the container go healthy in seconds. Some sort of a --wait-for-start option that triggers this behavior would be backward compatible and cover all discussed use cases, right? |
|
@cpuguy83 @dtakken Ok, I think I got it. |
|
Discussing in the maintainers meeting: one option is to add a That configuration would:
Combining this with start-period: This would:
|
|
@thaJeztah The |
|
What's the current status here? |
|
I've created #40894 to replace this. |
- What I did
This fix tries to address the issue raised in #33410 where the first healthcheck was only performed after the specified interval.
That might be problematic in case the interval is long yet, as is specified in #33410.
- How I did it
This fix make the following changes:
The changes allows the backward-compatibility while at the same
time it is possbile to address the issue raised in #33410.
- How to verify it
Additional test cases have been added.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
This fix fixes #33410.
Signed-off-by: Yong Tang [email protected]