Skip to content

Commit

Permalink
Add comment to health checker repair function to explain the need of …
Browse files Browse the repository at this point in the history
…kill instead of restart
  • Loading branch information
wangzhen127 committed Apr 5, 2024
1 parent 13b65d0 commit aed8810
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/healthchecker/health_checker_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func getUptimeFunc(service string) func() (time.Duration, error) {

// getRepairFunc returns the repair function based on the component.
func getRepairFunc(hco *options.HealthCheckerOptions) func() {
// Use `systemctl kill` instead of `systemctl restart` for the repair function.
// We start to rely on the kernel message difference for the two commands to
// indicate if the component restart is due to an administrative plan (restart)
// or a system issue that needs repair (kill).
// See https://github.com/kubernetes/node-problem-detector/issues/847.
switch hco.Component {
case types.DockerComponent:
// Use "docker ps" for docker health check. Not using crictl for docker to remove
Expand Down

0 comments on commit aed8810

Please sign in to comment.