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 committed Aug 31, 2024
1 parent 346b818 commit 296d0c8
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 296d0c8

Please sign in to comment.