Skip to content

do not stop health check before sending signal#37263

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

do not stop health check before sending signal#37263
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Jun 11, 2018

Docker daemon always stops healthcheck now before sending signal
to a container now. However, when we use "docker kill" to send
signals other than SIGTERM or SIGKILL to a container, such as SIGINT,
daemon still stops container health check though container process
handles the signal normally and continues to work.

- What I did
Fix that container health check stops working when sending signals to a container by docker kill.
- How I did it
Do not stop health check before sending signal to a container.
Daemon state monitor can stop health check when container state changes to exit.
- How to verify it
Run a container with health check.
Send signal other than SIGTERM or SIGKILL to container by docker kill.
Check container health status by docker inspect.
- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@GordonTheTurtle GordonTheTurtle added dco/no Automatically set by a bot when one of the commits lacks proper signature status/0-triage and removed dco/no Automatically set by a bot when one of the commits lacks proper signature labels Jun 11, 2018
@ghost
Copy link
Author

ghost commented Jun 13, 2018

Do i need to start an issue to describe the bug?

@moby moby deleted a comment from GordonTheTurtle Jun 13, 2018
@WeiZhang555
Copy link
Contributor

ping docker maintainers @cpuguy83 @vdemeester @thaJeztah
I think this is a bug fix.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

SGTM, but would like some other maintainers to have a look as well, in case I overlook something

ping @mlaventure @vdemeester @tonistiigi PTAL

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

Can you add a test case for this?

@mlaventure
Copy link
Contributor

Thanks for the PR @Kazero0, the change makes sense to me, I would indeed consider it a bug fix, but a test would be useful indeed :)

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #37263 into master will decrease coverage by 1.46%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #37263      +/-   ##
==========================================
- Coverage   36.54%   35.08%   -1.47%     
==========================================
  Files         608      608              
  Lines       45036    44967      -69     
==========================================
- Hits        16460    15778     -682     
- Misses      26295    27079     +784     
+ Partials     2281     2110     -171

@ghost ghost requested a review from vdemeester as a code owner December 22, 2018 07:05
@ghost
Copy link
Author

ghost commented Dec 22, 2018

Sorry that I've forgotten this patch. :(
Testcase updated.

Docker daemon always stops healthcheck before sending signal to a
container now. However, when we use "docker kill" to send signals
other than SIGTERM or SIGKILL to a container, such as SIGINT,
daemon still stops container health check though container process
handles the signal normally and continues to work.

Signed-off-by: Ruilin Li <liruilin4@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants