From 64518683f204b791b7ac9ced6d90eb36d294e566 Mon Sep 17 00:00:00 2001 From: zhongtao Date: Thu, 25 Apr 2024 19:36:52 +0800 Subject: [PATCH] bugfix of background execution exec error command and setting negative cpu-rt issue Signed-off-by: zhongtao (cherry picked from commit e133dc27e3d3a768bd7f81c4423c7ff092bd1e7e) --- ...kground-execution-exec-error-command.patch | 33 +++++++++++++++++ ...ng-cpu-rt-to-a-negative-value-when-e.patch | 35 +++++++++++++++++++ iSulad.spec | 10 +++++- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 0074-bugfix-of-background-execution-exec-error-command.patch create mode 100644 0075-bugfix-for-setting-cpu-rt-to-a-negative-value-when-e.patch diff --git a/0074-bugfix-of-background-execution-exec-error-command.patch b/0074-bugfix-of-background-execution-exec-error-command.patch new file mode 100644 index 0000000..6aca398 --- /dev/null +++ b/0074-bugfix-of-background-execution-exec-error-command.patch @@ -0,0 +1,33 @@ +From 2c86e55d98b0d62c534ff5810c1eb1d327d6425a Mon Sep 17 00:00:00 2001 +From: zhongtao +Date: Tue, 23 Apr 2024 17:44:00 +1400 +Subject: [PATCH 74/75] bugfix of background execution exec error command + +Signed-off-by: zhongtao +--- + src/daemon/modules/runtime/isula/isula_rt_ops.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/daemon/modules/runtime/isula/isula_rt_ops.c b/src/daemon/modules/runtime/isula/isula_rt_ops.c +index 47a14b1d..854752ea 100644 +--- a/src/daemon/modules/runtime/isula/isula_rt_ops.c ++++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c +@@ -1099,6 +1099,15 @@ static int get_container_process_pid(const char *workdir) + util_usleep_nointerupt(100000); + continue; + } ++ // If isulad does not read the container process pid, but isulad-shim reads the pid, ++ // and the container process exits, isulad-shim exits accordingly. ++ // At this time, exec should return true, because the container process has been created successfully ++ // and exec is successful, just because The process executes too fast causing isulad to not be read correctly ++ file_read_int(fname, &pid); ++ if (pid != 0) { ++ DEBUG("Process exit and isulad-shim exit"); ++ return pid; ++ } + ERROR("failed read pid from dead shim %s", workdir); + return -1; + } +-- +2.25.1 + diff --git a/0075-bugfix-for-setting-cpu-rt-to-a-negative-value-when-e.patch b/0075-bugfix-for-setting-cpu-rt-to-a-negative-value-when-e.patch new file mode 100644 index 0000000..7ea77a4 --- /dev/null +++ b/0075-bugfix-for-setting-cpu-rt-to-a-negative-value-when-e.patch @@ -0,0 +1,35 @@ +From bd18051dade97d4f75346cb67beea551a38ca13e Mon Sep 17 00:00:00 2001 +From: zhongtao +Date: Tue, 23 Apr 2024 20:52:04 +0800 +Subject: [PATCH 75/75] bugfix for setting cpu-rt to a negative value when env + not supports cpu-rt + +Signed-off-by: zhongtao +--- + src/daemon/modules/spec/verify.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/daemon/modules/spec/verify.c b/src/daemon/modules/spec/verify.c +index 617b7f23..57e16ef9 100644 +--- a/src/daemon/modules/spec/verify.c ++++ b/src/daemon/modules/spec/verify.c +@@ -381,14 +381,14 @@ static int verify_cpu_realtime(const sysinfo_t *sysinfo, int64_t realtime_period + { + int ret = 0; + +- if (realtime_period > 0 && !(sysinfo->cgcpuinfo.cpu_rt_period)) { ++ if (realtime_period != 0 && !(sysinfo->cgcpuinfo.cpu_rt_period)) { + ERROR("Invalid --cpu-rt-period: Your kernel does not support cgroup rt period"); + isulad_set_error_message("Invalid --cpu-rt-period: Your kernel does not support cgroup rt period"); + ret = -1; + goto out; + } + +- if (realtime_runtime > 0 && !(sysinfo->cgcpuinfo.cpu_rt_runtime)) { ++ if (realtime_runtime != 0 && !(sysinfo->cgcpuinfo.cpu_rt_runtime)) { + ERROR("Invalid --cpu-rt-runtime: Your kernel does not support cgroup rt runtime"); + isulad_set_error_message("Invalid --cpu-rt-period: Your kernel does not support cgroup rt runtime"); + ret = -1; +-- +2.25.1 + diff --git a/iSulad.spec b/iSulad.spec index ec52ff0..46b793f 100644 --- a/iSulad.spec +++ b/iSulad.spec @@ -1,5 +1,5 @@ %global _version 2.1.5 -%global _release 6 +%global _release 7 %global is_systemd 1 %global enable_criv1 1 %global enable_cdi 1 @@ -89,6 +89,8 @@ Patch0070: 0070-isolate-sandboxer-code-by-using-macro.patch Patch0071: 0071-Remove-sandboxer-ut-if-sandboxer-is-not-enabled.patch Patch0072: 0072-cdi-design-doc.patch Patch0073: 0073-bugfix-cdi-version-check.patch +Patch0074: 0074-bugfix-of-background-execution-exec-error-command.patch +Patch0075: 0075-bugfix-for-setting-cpu-rt-to-a-negative-value-when-e.patch %ifarch x86_64 aarch64 Provides: libhttpclient.so()(64bit) @@ -345,6 +347,12 @@ fi %endif %changelog +* Thu Apr 25 2024 zhongtao - 2.1.5-7 +- Type: update +- ID: NA +- SUG: NA +- DESC: bugfix of background execution exec error command and setting negative cpu-rt issue + * Sat Apr 20 2024 liuxu - 2.1.5-6 - Type: update - ID: NA