Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcontainer/cgroups/fs: fix OCI runtime pause failed #4388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libcontainer/cgroups/fs/freezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) {
// Alas, this is still a game of chances, since the real fix
// belong to the kernel (cgroup v2 do not have this bug).

var d time.Duration = 1
for i := 0; i < 1000; i++ {
if i%50 == 49 {
// Occasional thaw and sleep improves
Expand All @@ -79,6 +80,14 @@ func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) {
// system.
time.Sleep(10 * time.Microsecond)
}

if i%200 == 199 {
// should sleep a longer time for
// some really very slow machine.
time.Sleep(d * time.Second)
d <<= 1
}

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