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