1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #27310 from swernli/servicing-error-reporting

Fixing error reporting on servicing failure
This commit is contained in:
John Howard 2016-10-12 08:47:54 -07:00 committed by GitHub
commit e736b9a172

View file

@ -1,6 +1,7 @@
package libcontainerd
import (
"fmt"
"io"
"strings"
"syscall"
@ -104,8 +105,10 @@ func (ctr *container) start() error {
exitCode := ctr.waitProcessExitCode(&ctr.process)
if exitCode != 0 {
logrus.Warnf("libcontainerd: servicing container %s returned non-zero exit code %d", ctr.containerID, exitCode)
return ctr.terminate()
if err := ctr.terminate(); err != nil {
logrus.Warnf("libcontainerd: terminating servicing container %s failed: %s", ctr.containerID, err)
}
return fmt.Errorf("libcontainerd: servicing container %s returned non-zero exit code %d", ctr.containerID, exitCode)
}
return ctr.hcsContainer.WaitTimeout(time.Minute * 5)