diff --git a/patch/0142-runc-freezer-add-delay-after-freeze.patch b/patch/0142-runc-freezer-add-delay-after-freeze.patch new file mode 100644 index 0000000000000000000000000000000000000000..2c9b149d5073a2e03eb8f68da076b1b03ca02e98 --- /dev/null +++ b/patch/0142-runc-freezer-add-delay-after-freeze.patch @@ -0,0 +1,54 @@ +From f128e6e6c63a45543d833b8a4db5e691cfa0a0cc Mon Sep 17 00:00:00 2001 +From: Lu Jingxiao +Date: Thu, 14 Sep 2023 11:44:43 +0800 +Subject: [PATCH] [Huawei] freezer: add delay after freeze + +reason: add delay after freeze and add a debug print. +backport from upstream manually with: + +Conflict:NA +Reference: +https://github.com/opencontainers/runc/commit/524abc59f46373a175b97bd07c4c7eccf5594cc6 +https://github.com/opencontainers/runc/commit/d1007b08a33ae63bb695fcb3244300c9bba2658a + +--- + libcontainer/cgroups/fs/freezer.go | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/libcontainer/cgroups/fs/freezer.go b/libcontainer/cgroups/fs/freezer.go +index 40f70c13..181caad1 100644 +--- a/libcontainer/cgroups/fs/freezer.go ++++ b/libcontainer/cgroups/fs/freezer.go +@@ -8,6 +8,7 @@ import ( + "strings" + "time" + ++ "github.com/Sirupsen/logrus" + "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/runc/libcontainer/configs" + ) +@@ -42,11 +43,21 @@ func (s *FreezerGroup) Set(path string, cgroup *configs.Cgroup) error { + if err := writeFile(path, "freezer.state", string(configs.Frozen)); err != nil { + return err + } ++ if i%25 == 24 { ++ // Occasional short sleep before reading ++ // the state back also improves the chances to ++ // succeed in freezing in case of a very slow ++ // system. ++ time.Sleep(10 * time.Microsecond) ++ } + state, err := readFile(path, "freezer.state") + if err != nil { + return err + } + if strings.TrimSpace(state) == string(configs.Frozen) { ++ if i > 1 { ++ logrus.Debugf("frozen after %d retries", i) ++ } + return nil + } + time.Sleep(1 * time.Millisecond) +-- +2.23.0 + diff --git a/runc.spec b/runc.spec index 910854d5455c523694d5e24626ef23f2939c3fc9..e1ab31ee7288f667670ea80f82e611b37ebc92ee 100644 --- a/runc.spec +++ b/runc.spec @@ -2,7 +2,7 @@ Name: docker-runc Version: 1.0.0.rc3 -Release: 215 +Release: 216 Summary: runc is a CLI tool for spawning and running containers according to the OCI specification. License: ASL 2.0 @@ -41,6 +41,12 @@ install -p -m 755 runc $RPM_BUILD_ROOT/%{_bindir}/runc %{_bindir}/runc %changelog +* Thu Oct 12 2023 zhongjiawei - 1.0.0.rc3-216 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:freezer add delay after freeze + * Mon Sep 18 2023 zhongjiawei - 1.0.0.rc3-215 - Type:bugfix - ID:NA diff --git a/series.conf b/series.conf index bc5ae688fa207f541e87e4550dc12c1d3bc0ed4b..9bd215479020e983461a660afff1ce998bb3c8f7 100644 --- a/series.conf +++ b/series.conf @@ -133,3 +133,4 @@ 0139-runc-ingore-error-when-force-deleting-a-non-exist-cont.patch 0140-runc-delete-invalid-cgroupinfo-logs.patch 0141-runc-libct-init-unify-init-fix-its-error-logic.patch +0142-runc-freezer-add-delay-after-freeze.patch