From a50d9c0765d9861d226b323ffe190c0c99c3ac17 Mon Sep 17 00:00:00 2001 From: Shukui Yang Date: Wed, 21 Mar 2018 05:37:36 -0400 Subject: [PATCH] Add if judgment before receiving operations on daemonWaitCh receive operations on a nil channel will always block, this lead containerd not started. Signed-off-by: Shukui Yang --- libcontainerd/remote_daemon.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcontainerd/remote_daemon.go b/libcontainerd/remote_daemon.go index 35ccc0e4a9..cc98456ba5 100644 --- a/libcontainerd/remote_daemon.go +++ b/libcontainerd/remote_daemon.go @@ -307,7 +307,9 @@ func (r *remote) monitorConnection(monitor *containerd.Client) { <-time.After(100 * time.Millisecond) system.KillProcess(r.daemonPid) } - <-r.daemonWaitCh + if r.daemonWaitCh != nil { + <-r.daemonWaitCh + } monitor.Close() os.Remove(r.GRPC.Address)