Skip to content

Commit

Permalink
Don't fail getting stats of unknown hierarchies.
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
  • Loading branch information
vmarmol committed Jun 20, 2014
1 parent 17ce8d8 commit f9b158d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cgroups/fs/apply_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ func GetStats(c *cgroups.Cgroup) (*cgroups.Stats, error) {

d, err := getCgroupData(c, 0)
if err != nil {
return nil, err
return nil, fmt.Errorf("getting CgroupData %s", err)
}

for _, sys := range subsystems {
if err := sys.GetStats(d, stats); err != nil {
return nil, err
for sysName, sys := range subsystems {
// Don't fail if a cgroup hierarchy was not found.
if err := sys.GetStats(d, stats); err != nil && err != cgroups.ErrNotFound {
return nil, fmt.Errorf("getting stats for system %q %s", sysName, err)
}
}

Expand Down

0 comments on commit f9b158d

Please sign in to comment.