Skip to content

Commit

Permalink
Merge pull request #349 from jchorl/jchorl/ignoretimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
fuweid authored Nov 5, 2024
2 parents 190de3b + 2e25118 commit ffca7ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cgroup2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -952,14 +952,16 @@ func startUnit(conn *systemdDbus.Conn, group string, properties []systemdDbus.Pr
}
}

systemdStartUnitTimeout := 30 * time.Second
select {
case s := <-statusChan:
if s != "done" {
attemptFailedUnitReset(conn, group)
return fmt.Errorf("error creating systemd unit `%s`: got `%s`", group, s)
}
case <-time.After(30 * time.Second):
log.G(ctx).Warnf("Timed out while waiting for StartTransientUnit(%s) completion signal from dbus. Continuing...", group)
case <-time.After(systemdStartUnitTimeout):
attemptFailedUnitReset(conn, group)
return fmt.Errorf("timed out while waiting for StartTransientUnit(%s) completion signal from dbus after %v", group, systemdStartUnitTimeout)
}

return nil
Expand Down

0 comments on commit ffca7ca

Please sign in to comment.