Merge pull request #607 from vburenin/dont-hang

Do not read all IO if a container is not started.
This commit is contained in:
Kenfe-Mickaël Laventure 2017-03-06 13:12:37 -08:00 committed by GitHub
commit a7cb5a783c
1 changed files with 4 additions and 2 deletions

View File

@ -242,8 +242,6 @@ var runCommand = cli.Command{
if err != nil {
return err
}
// Ensure we read all io
defer fwg.Wait()
response, err := containers.Create(gocontext.Background(), create)
if err != nil {
@ -254,6 +252,10 @@ var runCommand = cli.Command{
}); err != nil {
return err
}
// Ensure we read all io only if container started successfully.
defer fwg.Wait()
status, err := waitContainer(events, response)
if err != nil {
return err