Skip to content

Commit 258e10d

Browse files
committed
fix: eventfd leak
Only start watching the cgroup for OOMs when the first process starts instead of on every process. Signed-off-by: Seth Pellegrino <[email protected]>
1 parent eb5e164 commit 258e10d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

runtime/v2/runc/v1/service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ func (s *service) Start(ctx context.Context, r *taskAPI.StartRequest) (*taskAPI.
271271
s.eventSendMu.Unlock()
272272
return nil, errdefs.ToGRPC(err)
273273
}
274-
if err := s.ep.Add(container.ID, container.Cgroup()); err != nil {
275-
logrus.WithError(err).Error("add cg to OOM monitor")
276-
}
277274
switch r.ExecID {
278275
case "":
276+
if err := s.ep.Add(container.ID, cg); err != nil {
277+
logrus.WithError(err).Error("add cg to OOM monitor")
278+
}
279279
s.send(&eventstypes.TaskStart{
280280
ContainerID: container.ID,
281281
Pid: uint32(p.Pid()),

0 commit comments

Comments
 (0)