Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
shimv2: multi wait support for wait service
Browse files Browse the repository at this point in the history
Support multi wait on one container/exec process.

Fixes: #1131

Signed-off-by: fupan <lifupan@gmail.com>
  • Loading branch information
lifupan committed Jan 16, 2019
1 parent 3a2c0a6 commit 5ba30fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions containerd-shim-v2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,12 +728,20 @@ func (s *service) Wait(ctx context.Context, r *taskAPI.WaitRequest) (*taskAPI.Wa
//wait for container
if r.ExecID == "" {
ret = <-c.exitCh

// refill the exitCh with the container process's exit code in case
// there were other waits on this process.
c.exitCh <- ret
} else { //wait for exec
execs, err := c.getExec(r.ExecID)
if err != nil {
return nil, err
}
ret = <-execs.exitCh

// refill the exitCh with the exec process's exit code in case
// there were other waits on this process.
execs.exitCh <- ret
}

return &taskAPI.WaitResponse{
Expand Down

0 comments on commit 5ba30fd

Please # to comment.