!377 sync from upstream openeuler/iSulad

From: @vegbir 
Reviewed-by: @jingwoo 
Signed-off-by: @jingwoo
This commit is contained in:
openeuler-ci-bot 2022-06-22 08:39:26 +00:00 committed by Gitee
commit 9ecb44f229
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
31 changed files with 255 additions and 57 deletions

View File

@ -1,7 +1,7 @@
From 9837be14200fecb32db0337652e60532f1adb7be Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Mon, 23 May 2022 17:06:19 +0800
Subject: [PATCH 01/28] do not mkdir of isulad if no controller found
Subject: [PATCH 01/30] do not mkdir of isulad if no controller found
If selinux disable the capibility DAC_OVERRIDE,
mkdir isulad may fail when run container.
@ -52,5 +52,5 @@ index e60377dd..6fb4ec38 100644
if (ret != 0 && (errno != EEXIST || !util_dir_exists(CGROUP_ISULAD_PATH))) {
return -1;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 426a282802b8b81c66e6857857a745583f816c0a Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Tue, 24 May 2022 16:51:02 +0800
Subject: [PATCH 02/28] fix install error when android
Subject: [PATCH 02/30] fix install error when android
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
@ -42,5 +42,5 @@ index 9efd16e9..5468111e 100644
lxc_path = selinux_lxc_contexts_path();
#endif
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 9ccb30fa430c7b98ecab4406dabe8498c74db8c3 Mon Sep 17 00:00:00 2001
From: chegJH <hejunjie10@huawei.com>
Date: Thu, 12 May 2022 16:40:41 +0800
Subject: [PATCH 03/28] imp fuzz for pw gr parser
Subject: [PATCH 03/30] imp fuzz for pw gr parser
Signed-off-by: chegJH <hejunjie10@huawei.com>
---
@ -245,5 +245,5 @@ index 00000000..3a2195c6
+
+}
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 31a92265a6bd29dc8f98179947406f1bb56ac5a8 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Thu, 26 May 2022 13:53:09 +0100
Subject: [PATCH 04/28] improve fuzz test
Subject: [PATCH 04/30] improve fuzz test
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
@ -115,5 +115,5 @@ index 8e975e3b..c333c0dd 100644
+ return nullptr;
}
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 02167555e702316fe14cc963f9e978e9f66f59ba Mon Sep 17 00:00:00 2001
From: chengzrz <czrzrichard@gmail.com>
Date: Fri, 24 Dec 2021 10:47:31 +0800
Subject: [PATCH 05/28] Seccomp optimization
Subject: [PATCH 05/30] Seccomp optimization
Signed-off-by: chengzrz <czrzrichard@gmail.com>
---
@ -258,5 +258,5 @@ index a647f7bc..278a72c5 100644
free(tmp_variant);
tmp_variant = NULL;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 1db2941da2eba089f3ed07c59f4925c857860023 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Tue, 31 May 2022 03:33:16 +0100
Subject: [PATCH 06/28] fix different type convert
Subject: [PATCH 06/30] fix different type convert
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
@ -260,5 +260,5 @@ index 5ea1677c..37475b33 100644
size_t ssize, dsize;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 17b6015d5abe3500a5a89d171af79698e57545f2 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Tue, 31 May 2022 19:35:35 +0800
Subject: [PATCH 07/28] add pointer parameters NULL check
Subject: [PATCH 07/30] add pointer parameters NULL check
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Signed-off-by: haozi007 <liuhao27@huawei.com>
@ -222,5 +222,5 @@ index 7f43ae57..6276a586 100644
if (ret < 0) {
return -1;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 56c2a6a98d51ea893939079cc31e3a7897fa5aba Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Tue, 31 May 2022 12:53:10 +0100
Subject: [PATCH 08/28] add check to arguments
Subject: [PATCH 08/30] add check to arguments
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
@ -529,5 +529,5 @@ index ce6dcc08..0068ecb4 100644
free(resolvedpath);
resolvedpath = nullptr;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 9133e2159e9e69434b41e9649762f8eaed191f37 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Tue, 31 May 2022 22:39:44 +0800
Subject: [PATCH 09/28] remove static of strlncat
Subject: [PATCH 09/30] remove static of strlncat
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
@ -22,5 +22,5 @@ index 0e0e603b..12df2435 100644
size_t ssize, dsize;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 60715b192de2cb1b4e8fe9ce48ddf081a6d2be53 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Wed, 1 Jun 2022 09:50:03 +0800
Subject: [PATCH 10/28] remove check parameter label_opts in init_label
Subject: [PATCH 10/30] remove check parameter label_opts in init_label
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
@ -22,5 +22,5 @@ index 533393a6..52422970 100644
return -1;
}
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 55a4f57232c42a9c2d36a41de5d743ee9ebbe88e Mon Sep 17 00:00:00 2001
From: vegbir <yangjiaqi16@huawei.com>
Date: Wed, 1 Jun 2022 13:44:37 +0800
Subject: [PATCH 11/28] update seccomp to Linux 5.10 syscall list
Subject: [PATCH 11/30] update seccomp to Linux 5.10 syscall list
Signed-off-by: yangjiaqi <yangjiaqi16@huawei.com>
---
@ -187,5 +187,5 @@ index 7218b99c..7b2fcad3 100644
"vfork",
"vmsplice",
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 8dcad172ea0241f35cdd464029523253ada7e99f Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Wed, 1 Jun 2022 12:53:56 +0100
Subject: [PATCH 12/28] fix invalid convert and format
Subject: [PATCH 12/30] fix invalid convert and format
1. invalid convert;
2. error print format;
@ -315,5 +315,5 @@ index 1ca901ea..5192d06f 100644
ERROR("Failed to create thread");
return -1;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From a96ad33008671e61bddebb744a7ac0aa3798313b Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Thu, 2 Jun 2022 10:33:07 +0800
Subject: [PATCH 13/28] fix get_network_namespace_path check
Subject: [PATCH 13/30] fix get_network_namespace_path check
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
@ -29,5 +29,5 @@ index 3888f556..2bf4cc36 100644
for (index = 0; index < jump_table_size; ++index) {
if (strncmp(network_mode, handler_jump_table[index].mode, strlen(handler_jump_table[index].mode)) == 0) {
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 7934311c1b1003021449b92900f3102ff77395e2 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Tue, 7 Jun 2022 15:19:20 +0800
Subject: [PATCH 14/28] bugfix for double free and use after free
Subject: [PATCH 14/30] bugfix for double free and use after free
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
@ -223,5 +223,5 @@ index 8492eb4d..b0dc7ee5 100644
return -1;
}
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 18db58c919bb9767bbe2f11c7447cfed27312c63 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Thu, 9 Jun 2022 21:16:26 +0800
Subject: [PATCH 15/28] fix isulad-shim coredump when remove ioc fd node
Subject: [PATCH 15/30] fix isulad-shim coredump when remove ioc fd node
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
@ -69,5 +69,5 @@ index 21b2523a..6de470f7 100644
/*
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From ae49fce8e19f7544c463cfbff58794f35f44c493 Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Thu, 9 Jun 2022 16:17:52 +0800
Subject: [PATCH 16/28] do not fail if pw is not NULL
Subject: [PATCH 16/30] do not fail if pw is not NULL
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
@ -61,5 +61,5 @@ index 00a32e05..bf9c9f06 100644
\ No newline at end of file
+}
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From b4596641a08891bfec9384f87815c8e671d594d4 Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Thu, 9 Jun 2022 17:07:40 +0800
Subject: [PATCH 17/28] do not fail if gr is NULL
Subject: [PATCH 17/30] do not fail if gr is NULL
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
@ -47,5 +47,5 @@ index bf9c9f06..c289e2b9 100644
fclose(f_gr);
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From eb168d32053f9204336c37af98210810957cedd2 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Fri, 10 Jun 2022 04:10:39 +0100
Subject: [PATCH 18/28] fix memory leak of remove layer
Subject: [PATCH 18/30] fix memory leak of remove layer
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
@ -52,5 +52,5 @@ index bb9e5b94..7e95a52f 100644
}
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 12bbd939c1c2c55d0906b5a53a0b9b26b616c56b Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Fri, 10 Jun 2022 04:16:48 +0100
Subject: [PATCH 19/28] add null terminal at end of gr mem list
Subject: [PATCH 19/30] add null terminal at end of gr mem list
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
@ -52,5 +52,5 @@ index c289e2b9..2a6b7e08 100644
}
EXPECT_TRUE(pgr == &gr);
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From b289a6b384ac5ba474dd477b2a92b89244b27c24 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Mon, 13 Jun 2022 14:35:46 +0800
Subject: [PATCH 20/28] fix shm size set invalid when reboot
Subject: [PATCH 20/30] fix shm size set invalid when reboot
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
@ -242,5 +242,5 @@ index 45b21ecd..7d05deb4 100644
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/utils/cutils/path.c
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/utils/cutils/map/map.c
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 8878630c20163dc9b716e2fdc35cae23b8aec6d1 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Tue, 14 Jun 2022 15:30:49 +0800
Subject: [PATCH 21/28] set the name of each container and image operation
Subject: [PATCH 21/30] set the name of each container and image operation
thread
Signed-off-by: wujing <wujing50@huawei.com>
@ -334,5 +334,5 @@ index dff07b39..79c4fb7c 100644
if (!status.ok()) {
return status;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 7d13b23a09d397f743acdcaf606804fea5989cff Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Tue, 14 Jun 2022 18:54:02 +0800
Subject: [PATCH 22/28] set the name of each container and image operation
Subject: [PATCH 22/30] set the name of each container and image operation
thread for restful version
Signed-off-by: wujing <wujing50@huawei.com>
@ -270,5 +270,5 @@ index 7107d255..bd367f29 100644
if (evhtp_request_get_method(req) != htp_method_POST) {
evhtp_send_reply(req, RESTFUL_RES_NOTIMPL);
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 59557dbd1b4d0bde973941d383a30a7b9e0d63d4 Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Thu, 16 Jun 2022 09:16:47 +0800
Subject: [PATCH 23/28] fix inspect -f error when bionic
Subject: [PATCH 23/30] fix inspect -f error when bionic
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
@ -28,5 +28,5 @@ index 5058fb95..55366551 100644
#define JSON_FORMAT_SECOND "^\\s*\\{\\s*\\{\\s*json\\s+(\\.\\w+)+\\s*\\}\\s*\\}\\s*$"
#endif
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 4c945810da8c645eb048e5fbb3a195da855bdcf7 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Sat, 14 May 2022 17:13:26 +0800
Subject: [PATCH 24/28] refactor devmapper_parse_options function
Subject: [PATCH 24/30] refactor devmapper_parse_options function
Signed-off-by: wujing <wujing50@huawei.com>
---
@ -285,5 +285,5 @@ index d90dde50..868e3086 100644
return 0;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 4df32783e4a665bd639f8b3ccd1b8860614eefb3 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Sat, 14 May 2022 15:33:33 +0800
Subject: [PATCH 25/28] refactor parse_volume function
Subject: [PATCH 25/30] refactor parse_volume function
Signed-off-by: wujing <wujing50@huawei.com>
---
@ -149,5 +149,5 @@ index ef2d58e4..3afa0962 100644
}
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From fdb731d7a272eb1574ef31b058beffbefffa1eb2 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Wed, 18 May 2022 10:30:35 +0800
Subject: [PATCH 26/28] fix parse volume failed
Subject: [PATCH 26/30] fix parse volume failed
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
@ -89,5 +89,5 @@ index 3afa0962..7b02f6ca 100644
util_free_array(modes);
if (ret != 0) {
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 7eda716c55d2247a79519a9f0a0950878eca6bf2 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Thu, 16 Jun 2022 19:53:11 +0800
Subject: [PATCH 27/28] use util_smart_calloc_t to prevent overflow
Subject: [PATCH 27/30] use util_smart_calloc_t to prevent overflow
Signed-off-by: wujing <wujing50@huawei.com>
---
@ -2102,5 +2102,5 @@ index 3c9d5004..d94229b2 100644
free_imagetool_image(tool_image);
tool_image = nullptr;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -1,7 +1,7 @@
From 2ca552a7faee850c6cfdccc4625b4459add56074 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Tue, 21 Jun 2022 17:34:23 +0800
Subject: [PATCH 28/28] increase websocket lws_lookup size
Subject: [PATCH 28/30] increase websocket lws_lookup size
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
@ -37,5 +37,5 @@ index 0e462737..98c0fee0 100644
rlimit oldLimit, newLimit;
newLimit.rlim_cur = WS_ULIMIT_FDS;
--
2.25.1
2.32.1 (Apple Git-133)

View File

@ -0,0 +1,88 @@
From 3bc72738519d6f38674c7ce8b9d89a9a5e160ae6 Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Tue, 21 Jun 2022 19:15:12 +0800
Subject: [PATCH 29/30] fix misuse of BUFSIZ
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
src/daemon/common/err_msg.c | 6 +++---
src/daemon/entry/cri/errors.cc | 3 +--
src/utils/cutils/error.h | 3 +--
src/utils/cutils/utils.c | 2 +-
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/daemon/common/err_msg.c b/src/daemon/common/err_msg.c
index 3e62fad6..531af82b 100644
--- a/src/daemon/common/err_msg.c
+++ b/src/daemon/common/err_msg.c
@@ -38,7 +38,7 @@ void isulad_set_error_message(const char *format, ...)
ret = vsnprintf(errbuf, BUFSIZ, format, argp);
va_end(argp);
- if (ret < 0 || ret >= BUFSIZ) {
+ if (ret < 0) {
return;
}
@@ -61,7 +61,7 @@ void isulad_try_set_error_message(const char *format, ...)
ret = vsnprintf(errbuf, BUFSIZ, format, argp);
va_end(argp);
- if (ret < 0 || ret >= BUFSIZ) {
+ if (ret < 0) {
return;
}
@@ -80,7 +80,7 @@ void isulad_append_error_message(const char *format, ...)
ret = vsnprintf(errbuf, BUFSIZ, format, argp);
va_end(argp);
- if (ret < 0 || ret >= BUFSIZ) {
+ if (ret < 0) {
return;
}
result = util_string_append(g_isulad_errmsg, errbuf);
diff --git a/src/daemon/entry/cri/errors.cc b/src/daemon/entry/cri/errors.cc
index a80ca433..3dc3bba6 100644
--- a/src/daemon/entry/cri/errors.cc
+++ b/src/daemon/entry/cri/errors.cc
@@ -117,8 +117,7 @@ void Errors::Errorf(const char *fmt, ...)
ret = vsnprintf(errbuf, BUFSIZ, fmt, argp);
va_end(argp);
- if (ret < 0 || ret >= BUFSIZ) {
- m_message = "Error message is too long";
+ if (ret < 0) {
return;
}
diff --git a/src/utils/cutils/error.h b/src/utils/cutils/error.h
index 28ad5dec..5a8dca99 100644
--- a/src/utils/cutils/error.h
+++ b/src/utils/cutils/error.h
@@ -64,8 +64,7 @@ static inline void format_errorf(char **err, const char *format, ...)
ret = vsnprintf(errbuf, BUFSIZ, format, argp);
va_end(argp);
- if (ret < 0 || ret >= BUFSIZ) {
- *err = util_strdup_s("Error is too long!!!");
+ if (ret < 0) {
return;
}
diff --git a/src/utils/cutils/utils.c b/src/utils/cutils/utils.c
index a47c5644..010f48b9 100644
--- a/src/utils/cutils/utils.c
+++ b/src/utils/cutils/utils.c
@@ -516,7 +516,7 @@ static void set_stderr_buf(char **stderr_buf, const char *format, ...)
int nret = vsnprintf(errbuf, BUFSIZ, format, argp);
va_end(argp);
- if (nret < 0 || nret >= BUFSIZ) {
+ if (nret < 0) {
return;
}
--
2.32.1 (Apple Git-133)

View File

@ -0,0 +1,102 @@
From 255208ba96242caed274a9659d6db2df51616d1b Mon Sep 17 00:00:00 2001
From: vegbir <yangjiaqi16@huawei.com>
Date: Tue, 21 Jun 2022 22:06:53 +0800
Subject: [PATCH 30/30] gc considers stored monitor pid
---
.../modules/container/restore/restore.c | 42 +++++++++++++++----
1 file changed, 34 insertions(+), 8 deletions(-)
diff --git a/src/daemon/modules/container/restore/restore.c b/src/daemon/modules/container/restore/restore.c
index a7ee11a2..aca17a15 100644
--- a/src/daemon/modules/container/restore/restore.c
+++ b/src/daemon/modules/container/restore/restore.c
@@ -98,12 +98,17 @@ out:
}
/* post stopped container to gc */
-static int post_stopped_container_to_gc(const char *id, const char *runtime, const char *statepath, uint32_t pid)
+static int post_stopped_container_to_gc(const char *id, const char *runtime, const char *statepath,
+ const pid_ppid_info_t *old_pid_info)
{
int ret = 0;
pid_ppid_info_t pid_info = { 0 };
- (void)util_read_pid_ppid_info(pid, &pid_info);
+ (void)util_read_pid_ppid_info(old_pid_info->pid, &pid_info);
+ if (pid_info.ppid == 0) {
+ pid_info.ppid = old_pid_info->ppid;
+ pid_info.pstart_time = old_pid_info->pstart_time;
+ }
if (gc_add_container(id, runtime, &pid_info)) {
ERROR("Failed to post container %s to garbage collector", id);
@@ -177,13 +182,17 @@ static void try_to_set_container_running(Container_Status status, container_t *c
static void restore_stopped_container(Container_Status status, const container_t *cont)
{
const char *id = cont->common_config->id;
- pid_t pid = 0;
+ pid_ppid_info_t pid_info = { 0 };
if (status != CONTAINER_STATUS_STOPPED && status != CONTAINER_STATUS_CREATED) {
if (util_process_alive(cont->state->state->pid, cont->state->state->start_time)) {
- pid = cont->state->state->pid;
+ pid_info.pid = cont->state->state->pid;
+ }
+ if (util_process_alive(cont->state->state->p_pid, cont->state->state->p_start_time)) {
+ pid_info.ppid = cont->state->state->p_pid;
+ pid_info.pstart_time = cont->state->state->p_start_time;
}
- int nret = post_stopped_container_to_gc(id, cont->runtime, cont->state_path, pid);
+ int nret = post_stopped_container_to_gc(id, cont->runtime, cont->state_path, &pid_info);
if (nret != 0) {
ERROR("Failed to post container %s to garbage"
"collector, that may lost some resources"
@@ -207,7 +216,13 @@ static void restore_running_container(Container_Status status, container_t *cont
container_state_reset_has_been_manual_stopped(cont->state);
} else {
ERROR("Failed to restore container:%s due to unable to read container pid information", id);
- nret = post_stopped_container_to_gc(id, cont->runtime, cont->state_path, 0);
+ pid_info.pid = 0;
+ pid_info.start_time = 0;
+ if (util_process_alive(cont->state->state->p_pid, cont->state->state->p_start_time)) {
+ pid_info.ppid = cont->state->state->p_pid;
+ pid_info.pstart_time = cont->state->state->p_start_time;
+ }
+ nret = post_stopped_container_to_gc(id, cont->runtime, cont->state_path, &pid_info);
if (nret != 0) {
ERROR("Failed to post container %s to garbage"
"collector, that may lost some resources"
@@ -233,7 +248,13 @@ static void restore_paused_container(Container_Status status, container_t *cont,
container_state_reset_has_been_manual_stopped(cont->state);
} else {
ERROR("Failed to restore container:%s due to unable to read container pid information", id);
- nret = post_stopped_container_to_gc(id, cont->runtime, cont->state_path, 0);
+ pid_info.pid = 0;
+ pid_info.start_time = 0;
+ if (util_process_alive(cont->state->state->p_pid, cont->state->state->p_start_time)) {
+ pid_info.ppid = cont->state->state->p_pid;
+ pid_info.pstart_time = cont->state->state->p_start_time;
+ }
+ nret = post_stopped_container_to_gc(id, cont->runtime, cont->state_path, &pid_info);
if (nret != 0) {
ERROR("Failed to post container %s to garbage"
"collector, that may lost some resources"
@@ -385,8 +406,13 @@ static void handle_restored_container()
if (container_is_running(cont->state)) {
if (restore_supervisor(cont) != 0) {
ERROR("Failed to restore %s supervisor, set state to stopped", id);
+ pid_ppid_info_t pid_info = { 0 };
+ if (util_process_alive(cont->state->state->p_pid, cont->state->state->p_start_time)) {
+ pid_info.ppid = cont->state->state->p_pid;
+ pid_info.pstart_time = cont->state->state->p_start_time;
+ }
container_state_set_stopped(cont->state, 255);
- if (post_stopped_container_to_gc(id, cont->runtime, cont->state_path, 0) != 0) {
+ if (post_stopped_container_to_gc(id, cont->runtime, cont->state_path, &pid_info) != 0) {
ERROR("Failed to post container %s to garbage"
"collector, that may lost some resources"
"used with container!",
--
2.32.1 (Apple Git-133)

View File

@ -1,5 +1,5 @@
%global _version 2.0.14
%global _release 9
%global _release 10
%global is_systemd 1
%global enable_shimv2 1
%global is_embedded 1
@ -41,6 +41,8 @@ Patch0025: 0025-refactor-parse_volume-function.patch
Patch0026: 0026-fix-parse-volume-failed.patch
Patch0027: 0027-use-util_smart_calloc_t-to-prevent-overflow.patch
Patch0028: 0028-increase-websocket-lws_lookup-size.patch
Patch0029: 0029-fix-misuse-of-BUFSIZ.patch
Patch0030: 0030-gc-considers-stored-monitor-pid.patch
%ifarch x86_64 aarch64
Provides: libhttpclient.so()(64bit)
@ -268,6 +270,12 @@ fi
%endif
%changelog
* Wed Jun 22 2022 yangjiaqi <yangjiaqi16@huawei.com> - 2.0.14-10
- Type: enhancement
- ID: NA
- SUG: NA
- DESC: sync from upstream openeuler/iSulad
* Tue Jun 21 2022 zhangxiaoyu <zhangxiaoyu58@huawei.com> - 2.0.14-9
- Type: enhancement
- ID: NA