Signed-off-by: John Howard <jhoward@microsoft.com>
| ... | ... |
@@ -1231,7 +1231,7 @@ func (s *DockerSuite) TestContainerApiPostContainerStop(c *check.C) {
|
| 1231 | 1231 |
c.Assert(err, checker.IsNil) |
| 1232 | 1232 |
// 204 No Content is expected, not 200 |
| 1233 | 1233 |
c.Assert(statusCode, checker.Equals, http.StatusNoContent) |
| 1234 |
- c.Assert(waitInspect(containerID, "{{ .State.Running }}", "false", 5*time.Second), checker.IsNil)
|
|
| 1234 |
+ c.Assert(waitInspect(containerID, "{{ .State.Running }}", "false", 60*time.Second), checker.IsNil)
|
|
| 1235 | 1235 |
} |
| 1236 | 1236 |
|
| 1237 | 1237 |
// #14170 |
| ... | ... |
@@ -167,11 +167,6 @@ func (ctr *container) waitExit(pid uint32, processFriendlyName string, isFirstPr |
| 167 | 167 |
logrus.Debugf("Completed shutting down container %s", ctr.containerID)
|
| 168 | 168 |
} |
| 169 | 169 |
|
| 170 |
- // BUGBUG - Is taking the lock necessary here? Should it just be taken for |
|
| 171 |
- // the deleteContainer call, not for the restart logic? @jhowardmsft |
|
| 172 |
- ctr.client.lock(ctr.containerID) |
|
| 173 |
- defer ctr.client.unlock(ctr.containerID) |
|
| 174 |
- |
|
| 175 | 170 |
if si.State == StateExit && ctr.restartManager != nil {
|
| 176 | 171 |
restart, wait, err := ctr.restartManager.ShouldRestart(uint32(exitCode), false) |
| 177 | 172 |
if err != nil {
|
| ... | ... |
@@ -182,6 +177,7 @@ func (ctr *container) waitExit(pid uint32, processFriendlyName string, isFirstPr |
| 182 | 182 |
go func() {
|
| 183 | 183 |
err := <-wait |
| 184 | 184 |
ctr.restarting = false |
| 185 |
+ ctr.client.deleteContainer(ctr.friendlyName) |
|
| 185 | 186 |
if err != nil {
|
| 186 | 187 |
si.State = StateExit |
| 187 | 188 |
if err := ctr.client.backend.StateChanged(ctr.containerID, si); err != nil {
|