Skip to content

Commit

Permalink
Fix nil pointer derefence on failure to connect to containerd
Browse files Browse the repository at this point in the history
Signed-off-by: Simão Reis <smnrsti@gmail.com>
  • Loading branch information
sreis committed Jan 30, 2019
1 parent 0d9dc3f commit 3134161
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libcontainerd/supervisor/remote_daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,15 @@ func (r *remote) monitorDaemon(ctx context.Context) {
delay = time.After(time.Duration(transientFailureCount) * 200 * time.Millisecond)
continue
}
client.Close()
client = nil
}

if system.IsProcessAlive(r.daemonPid) {
r.logger.WithField("pid", r.daemonPid).Info("killing and restarting containerd")
r.killDaemon()
}

client.Close()
client = nil
r.daemonPid = -1
delay = nil
transientFailureCount = 0
Expand Down

0 comments on commit 3134161

Please sign in to comment.