Skip to content

Commit

Permalink
Merge pull request #1754 from vikaschoudhary16/add-timeout
Browse files Browse the repository at this point in the history
Add timeout while waiting for StartTransinetUnit completion signal
  • Loading branch information
hqhq authored Mar 8, 2018
2 parents 108570c + 04e95b5 commit 9facb87
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libcontainer/cgroups/systemd/apply_systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/opencontainers/runc/libcontainer/cgroups/fs"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/sirupsen/logrus"
)

type Manager struct {
Expand Down Expand Up @@ -300,7 +301,11 @@ func (m *Manager) Apply(pid int) error {
return err
}

<-statusChan
select {
case <-statusChan:
case <-time.After(time.Second):
logrus.Warnf("Timed out while waiting for StartTransientUnit completion signal from dbus. Continuing...")
}

if err := joinCgroups(c, pid); err != nil {
return err
Expand Down

0 comments on commit 9facb87

Please sign in to comment.