Browse code

Lock container when set state to restarting

After exec driver run, container lock is lost, so we should lock
container when changing its state to `restarting`

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>

Zhang Wei authored on 2016/02/02 20:50:06
Showing 1 changed files
... ...
@@ -218,7 +218,7 @@ func (m *containerMonitor) start() error {
218 218
 		m.resetMonitor(err == nil && exitStatus.ExitCode == 0)
219 219
 
220 220
 		if m.shouldRestart(exitStatus.ExitCode) {
221
-			m.container.SetRestarting(&exitStatus)
221
+			m.container.SetRestartingLocking(&exitStatus)
222 222
 			m.logEvent("die")
223 223
 			m.resetContainer(true)
224 224