Skip to content

Commit c6112ac

Browse files
author
Song Zhang
committed
libcontainer/cgroups/fs: fix OCI runtime pause failed
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]>
1 parent 346b818 commit c6112ac

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libcontainer/cgroups/fs/freezer.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) {
5858
// Alas, this is still a game of chances, since the real fix
5959
// belong to the kernel (cgroup v2 do not have this bug).
6060

61+
var d time.Duration = 1
6162
for i := 0; i < 1000; i++ {
6263
if i%50 == 49 {
6364
// Occasional thaw and sleep improves
@@ -79,6 +80,14 @@ func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) {
7980
// system.
8081
time.Sleep(10 * time.Microsecond)
8182
}
83+
84+
if i%200 == 199 {
85+
// should sleep a longer time for
86+
// some really very slow machine.
87+
time.Sleep(d * time.Second)
88+
d <<= 1
89+
}
90+
8291
state, err := cgroups.ReadFile(path, "freezer.state")
8392
if err != nil {
8493
return err

0 commit comments

Comments
 (0)