Skip to content

Commit

Permalink
Add timeout while waiting for StartTransinetUnit completion signal fr…
Browse files Browse the repository at this point in the history
…om dbus

Signed-off-by: vikaschoudhary16 <choudharyvikas16@gmail.com>
  • Loading branch information
vikaschoudhary16 committed Mar 7, 2018
1 parent ce80fa0 commit 04e95b5
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 04e95b5

Please sign in to comment.