代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/iSulad 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 57921deef3849f519b3fffdcf76184144ba54fb3 Mon Sep 17 00:00:00 2001
From: zhongtao <[email protected]>
Date: Tue, 16 May 2023 15:16:13 +0800
Subject: [PATCH 5/9] recheck delete command exit status
Signed-off-by: zhongtao <[email protected]>
---
.../modules/runtime/isula/isula_rt_ops.c | 24 ++++++++++++-------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/daemon/modules/runtime/isula/isula_rt_ops.c b/src/daemon/modules/runtime/isula/isula_rt_ops.c
index 9008c5c7..07f714f0 100644
--- a/src/daemon/modules/runtime/isula/isula_rt_ops.c
+++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c
@@ -635,9 +635,9 @@ static int runtime_call_simple(const char *workdir, const char *runtime, const c
}
// oci runtime return -1 if the container 'does not exist'
-// if output contains 'does not exist', means nothing to kill, return 0
-// this will change the exit status of kill command
-static int kill_output_check(const char *output)
+// if output contains 'does not exist', means nothing to kill or delete, return 0
+// this will change the exit status of kill or delete command
+static int non_existent_output_check(const char *output)
{
char *pattern = "does not exist";
@@ -645,24 +645,24 @@ static int kill_output_check(const char *output)
return -1;
}
- // container not exist, kill success, return 0
+ // container not exist, kill or delete success, return 0
if (util_strings_contains_word(output, pattern)) {
return 0;
}
- // kill failed, return -1
+ // kill or delete failed, return -1
return -1;
}
-// kill success or kill_output_check succeed return 0, DO_RETRY_CALL will break;
+// kill success or non_existent_output_check succeed return 0, DO_RETRY_CALL will break;
// if kill failed, recheck on shim alive, if not alive, kill succeed, still return 0;
// else, return -1, DO_RETRY_CALL will call this again;
static int runtime_call_kill_and_check(const char *workdir, const char *runtime, const char *id)
{
int ret = -1;
- // kill succeed, return 0; kill_output_check succeed, return 0;
- ret = runtime_call_simple(workdir, runtime, "kill", NULL, 0, id, kill_output_check);
+ // kill succeed, return 0; non_existent_output_check succeed, return 0;
+ ret = runtime_call_simple(workdir, runtime, "kill", NULL, 0, id, non_existent_output_check);
if (ret == 0) {
return 0;
}
@@ -677,7 +677,13 @@ static int runtime_call_kill_and_check(const char *workdir, const char *runtime,
static int runtime_call_delete_force(const char *workdir, const char *runtime, const char *id)
{
const char *opts[1] = { "--force" };
- return runtime_call_simple(workdir, runtime, "delete", opts, 1, id, NULL);
+ // delete succeed, return 0;
+ // When the runc version is less than or equal to v1.0.0-rc3,
+ // if the container does not exist when force deleting it,
+ // runc will report an error and isulad does not need to retry the deletion again.
+ // related PR ID:d1a743674a98e23d348b29f52c43436356f56b79
+ // non_existent_output_check succeed, return 0;
+ return runtime_call_simple(workdir, runtime, "delete", opts, 1, id, non_existent_output_check);
}
#define ExitSignalOffset 128
--
2.40.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。