Browse code

Fix data race in libcontainerd

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

Kenfe-Mickael Laventure authored on 2016/07/14 02:04:42
Showing 1 changed files
... ...
@@ -142,8 +142,8 @@ func (r *remote) handleConnectionChange() {
142 142
 					transientFailureCount = 0
143 143
 					if utils.IsProcessAlive(r.daemonPid) {
144 144
 						utils.KillProcess(r.daemonPid)
145
-						<-r.daemonWaitCh
146 145
 					}
146
+					<-r.daemonWaitCh
147 147
 					if err := r.runContainerdDaemon(); err != nil { //FIXME: Handle error
148 148
 						logrus.Errorf("error restarting containerd: %v", err)
149 149
 					}