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:
commit
e736b9a172
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package libcontainerd
|
package libcontainerd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
@ -104,8 +105,10 @@ func (ctr *container) start() error {
|
||||||
exitCode := ctr.waitProcessExitCode(&ctr.process)
|
exitCode := ctr.waitProcessExitCode(&ctr.process)
|
||||||
|
|
||||||
if exitCode != 0 {
|
if exitCode != 0 {
|
||||||
logrus.Warnf("libcontainerd: servicing container %s returned non-zero exit code %d", ctr.containerID, exitCode)
|
if err := ctr.terminate(); err != nil {
|
||||||
return ctr.terminate()
|
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)
|
return ctr.hcsContainer.WaitTimeout(time.Minute * 5)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue