Skip to content

Commit

Permalink
libcontainer/cgroups/fs: fix OCI runtime pause failed
Browse files Browse the repository at this point in the history
For some instance, runc pause still failed with
`ctr: OCI runtime pause failed: unable to freeze: unknown`.

We should let it sleep a longer time for some really very
slow system or machine.

Signed-off-by: Song Zhang <[email protected]>
  • Loading branch information
Song Zhang authored and botieking98 committed Sep 14, 2024
1 parent 1590491 commit f0936b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libcontainer/cgroups/fs/freezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) {
// system.
time.Sleep(10 * time.Microsecond)
}

if i%500 == 499 {
// should sleep a longer time for
// some really very slow machine.
time.Sleep(5 * time.Second)
}

state, err := cgroups.ReadFile(path, "freezer.state")
if err != nil {
return err
Expand Down

0 comments on commit f0936b9

Please sign in to comment.