iSulad/0219-bugfix-of-background-execution-exec-error-command.patch
2024-10-18 10:47:42 +08:00

34 lines
1.5 KiB
Diff

From e4aa3e0a14cb428496af37d99f13543cc17a8236 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Tue, 23 Apr 2024 17:44:00 +1400
Subject: [PATCH 219/226] bugfix of background execution exec error command
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
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 949bce7a..5ccead58 100644
--- a/src/daemon/modules/runtime/isula/isula_rt_ops.c
+++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c
@@ -953,6 +953,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.33.0