Skip to content

Commit fca0da4

Browse files
authored
Merge pull request #5364 from wzshiming/fix/list-pids-lock
runtime/v1: Add lock for ListPids
2 parents 88b09e6 + fcf3b27 commit fca0da4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

runtime/v1/shim/service.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ func (s *Service) ListPids(ctx context.Context, r *shimapi.ListPidsRequest) (*sh
397397
return nil, errdefs.ToGRPC(err)
398398
}
399399
var processes []*task.ProcessInfo
400+
401+
s.mu.Lock()
402+
defer s.mu.Unlock()
400403
for _, pid := range pids {
401404
pInfo := task.ProcessInfo{
402405
Pid: pid,

0 commit comments

Comments
 (0)