Retry on pidfile read error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
707555be47
commit
f9ecd09f4f
3 changed files with 3 additions and 2 deletions
|
@ -313,7 +313,7 @@ func (c *container) writeEventFD(root string, cfd, efd int) error {
|
|||
func waitForStart(p *process, cmd *exec.Cmd) error {
|
||||
for i := 0; i < 300; i++ {
|
||||
if _, err := p.getPidFromFile(); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if os.IsNotExist(err) || err == errInvalidPidInt {
|
||||
alive, err := isAlive(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -199,7 +199,7 @@ func (p *process) getPidFromFile() (int, error) {
|
|||
}
|
||||
i, err := strconv.Atoi(string(data))
|
||||
if err != nil {
|
||||
return -1, err
|
||||
return -1, errInvalidPidInt
|
||||
}
|
||||
p.pid = i
|
||||
return i, nil
|
||||
|
|
|
@ -19,6 +19,7 @@ var (
|
|||
ErrContainerNotStarted = errors.New("containerd: container not started")
|
||||
|
||||
errNoPidFile = errors.New("containerd: no process pid file found")
|
||||
errInvalidPidInt = errors.New("containerd: process pid is invalid")
|
||||
errNotImplemented = errors.New("containerd: not implemented")
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue