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

handleConnectionChange() in dockerd kills containerd 'silently' / without notification to user #314

Open
rh-ulrich-o opened this issue Jun 25, 2018 · 0 comments

Comments

@rh-ulrich-o
Copy link

The handleConnectionChange() function in dockerd monitors the health of containerd by sending grpc 'HealthCheckRequest' messages periodically. If containerd is unresponsive to such messages during a certain amount of time, dockerd initiates a restart of containerd. The amount of time is determined by two hard-coded constants: containerdHealthCheckTimeout and maxConnectionRetryCount. A simple experiment (sending a STOP signal to containerd) demonstrates that dockerd kills containerd after only a few seconds of unresponsiveness.

The issue is that handleConnectionChange() kills containerd 'silently', i.e. this leaves the user with no clue at all as to what happened. The monitorConnection() function in upstream moby code includes some useful improvements in this regard.

  • It logs an informative message "killing and restarting containerd".
  • It tries to obtain a goroutine stack dump of containerd via SIGUSR1.

Related snippet of code from monitorConnection():

if system.IsProcessAlive(r.daemonPid) {
        r.logger.WithField("pid", r.daemonPid).Info("killing and restarting containerd")
        // Try to get a stack trace
        syscall.Kill(r.daemonPid, syscall.SIGUSR1)
        <-time.After(100 * time.Millisecond)
        system.KillProcess(r.daemonPid)
}

Please consider a back-port of these improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant