summaryrefslogtreecommitdiff
path: root/0113-move-shutdown-handle-after-init-module.patch
diff options
context:
space:
mode:
Diffstat (limited to '0113-move-shutdown-handle-after-init-module.patch')
-rw-r--r--0113-move-shutdown-handle-after-init-module.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/0113-move-shutdown-handle-after-init-module.patch b/0113-move-shutdown-handle-after-init-module.patch
new file mode 100644
index 0000000..5ac3acc
--- /dev/null
+++ b/0113-move-shutdown-handle-after-init-module.patch
@@ -0,0 +1,43 @@
+From 0ae6244c6bfed229a46d300888977a4967e1d718 Mon Sep 17 00:00:00 2001
+From: zhongtao <zhongtao17@huawei.com>
+Date: Wed, 19 Jun 2024 09:50:51 +0800
+Subject: [PATCH 113/121] move shutdown handle after init module
+
+Signed-off-by: zhongtao <zhongtao17@huawei.com>
+---
+ src/cmd/isulad/main.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/cmd/isulad/main.c b/src/cmd/isulad/main.c
+index 3e2249d7..52ac3172 100644
+--- a/src/cmd/isulad/main.c
++++ b/src/cmd/isulad/main.c
+@@ -1669,11 +1669,6 @@ static int start_daemon_threads()
+ {
+ int ret = -1;
+
+- if (new_shutdown_handler()) {
+- ERROR("Create new shutdown handler thread failed");
+- goto out;
+- }
+-
+ if (events_module_init() != 0) {
+ goto out;
+ }
+@@ -1825,6 +1820,13 @@ int main(int argc, char **argv)
+ goto failure;
+ }
+
++ // after all modules are initialized, enable the shutdown handler to
++ // prevent shutdown handler from cleaning up incompletely initialized modules.
++ if (new_shutdown_handler()) {
++ ERROR("Create new shutdown handler thread failed");
++ goto failure;
++ }
++
+ #ifdef ENABLE_PLUGIN
+ if (start_plugin_manager()) {
+ ERROR("Failed to init plugin_manager");
+--
+2.25.1
+