mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 07:33:01 +02:00
patches/sysrepo: exit sysrepo-plugind on thread processing error
When sysrepo-plugind is processing callback events, make sure to log the error and exit(1) the entire process so the system can handle the problem. For example, restart all dependent services. Fixes #585 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
From dcd594e7c7e2b47b489243ce823e58e6b674bea3 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Tue, 28 Mar 2023 10:37:53 +0200
|
||||
Subject: [PATCH 1/6] sysrepo-plugind: add support for running in foreground
|
||||
Subject: [PATCH 1/9] sysrepo-plugind: add support for running in foreground
|
||||
with syslog
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
@@ -67,5 +67,5 @@ index a6a817cc..5baebec3 100644
|
||||
/* plugin-install */
|
||||
if (get_plugins_dir(&plugins_dir)) {
|
||||
--
|
||||
2.34.1
|
||||
2.43.0
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
From 2a826d77d83930b32f2bdcf32ef9c57c616ec526 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Tue, 7 May 2024 15:41:53 +0200
|
||||
Subject: [PATCH 2/6] Allow SR_EV_DONE to return any error to sysrepocfg
|
||||
Subject: [PATCH 2/9] Allow SR_EV_DONE to return any error to sysrepocfg
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Importing a system configuration with sysrepocfg the model callbacks do
|
||||
@@ -148,5 +148,5 @@ index 8778956b..35a1fd8c 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.34.1
|
||||
2.43.0
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
From 89fdf6691229f8f0978ca9bb13fa0143e0e79dbd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
|
||||
Date: Wed, 8 May 2024 17:00:50 +0200
|
||||
Subject: [PATCH 3/6] Allow to copy from factory default
|
||||
Subject: [PATCH 3/9] Allow to copy from factory default
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
src/sysrepo.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
@@ -22,5 +23,5 @@ index 35a1fd8c..c15855e9 100644
|
||||
|
||||
if (src_datastore == session->ds) {
|
||||
--
|
||||
2.34.1
|
||||
2.43.0
|
||||
|
||||
|
||||
+4
-2
@@ -1,11 +1,13 @@
|
||||
From c7cd85da2831a5c1476e6ebe60431b87382c74c8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
|
||||
Date: Mon, 6 May 2024 14:49:32 +0200
|
||||
Subject: [PATCH 4/6] Add -z switch to sysrepoctl to install factory config
|
||||
Subject: [PATCH 4/9] Add -z switch to sysrepoctl to install factory config
|
||||
from a json file
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
This to be able to load the yang modules during build time instead on boot.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
src/executables/sysrepoctl.c | 20 +++++++++++++--
|
||||
src/lyd_mods.h | 7 ++++++
|
||||
@@ -172,5 +174,5 @@ index 8a6a70b8..41c9e52b 100644
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
--
|
||||
2.34.1
|
||||
2.43.0
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
From 8181ce6caf5ee49e30a02db9695647bd7bc73838 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Vasko <mvasko@cesnet.cz>
|
||||
Date: Tue, 2 Jul 2024 12:11:30 +0200
|
||||
Subject: [PATCH 5/6] modinfo BUGFIX memory leak
|
||||
Subject: [PATCH 5/9] modinfo BUGFIX memory leak
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
src/modinfo.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
@@ -24,5 +25,5 @@ index 949c321b..9edb4498 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.34.1
|
||||
2.43.0
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
From 3d297a0305e35007c4e16eb729025a0e58a0bcd2 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Vasko <mvasko@cesnet.cz>
|
||||
Date: Fri, 28 Jun 2024 14:10:25 +0200
|
||||
Subject: [PATCH 6/6] sub ntf BUGFIX proper invalid FD check
|
||||
Subject: [PATCH 6/9] sub ntf BUGFIX proper invalid FD check
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
src/utils/subscribed_notifications.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
@@ -22,5 +23,5 @@ index 0055f10a..a0694d04 100644
|
||||
/* add into the pollfd structure */
|
||||
err_info = srsn_dispatch_add(fd, cb_data);
|
||||
--
|
||||
2.34.1
|
||||
2.43.0
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From da765b90bca45b91f72fd6525e680040eebd2d4b Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Wed, 21 Aug 2024 16:00:35 +0200
|
||||
Subject: [PATCH 7/8] Introduce new log level [SEC]
|
||||
Subject: [PATCH 7/9] Introduce new log level [SEC]
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
This adds a new log level for security and audit trail related log
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7e49f394e0afedc0259d4364f5a9a83296fe2b72 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Wed, 21 Aug 2024 16:04:43 +0200
|
||||
Subject: [PATCH 8/8] Add audit trail for high priority system changes
|
||||
Subject: [PATCH 8/9] Add audit trail for high priority system changes
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
Committing a change to running, copying to a datastore, or calling an
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 5c4df9f535f6fbdc6dc0573a47c47be2d02f1774 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Fri, 23 Aug 2024 12:22:06 +0200
|
||||
Subject: [PATCH 9/9] On error in sr_shmsub_listen_thread(), exit process
|
||||
Organization: Addiva Elektronik
|
||||
|
||||
If processing callback events in, e.g., sysrepo-plugind, make sure to
|
||||
log the error and exit(1) the entire process so the system can decide
|
||||
to handle the problem. For example, restart all dependent services.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
src/shm_sub.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/shm_sub.c b/src/shm_sub.c
|
||||
index 363883ab..a1e68903 100644
|
||||
--- a/src/shm_sub.c
|
||||
+++ b/src/shm_sub.c
|
||||
@@ -4918,6 +4918,7 @@ sr_shmsub_listen_thread(void *arg)
|
||||
* another event is generated, our event pipe will not get notified */
|
||||
continue;
|
||||
} else if (ret) {
|
||||
+ SR_LOG_WRN("failed sr_subscription_process_events(), ret:%d", ret);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -4958,5 +4959,7 @@ error:
|
||||
/* free our own resources */
|
||||
ATOMIC_STORE_RELAXED(subscr->thread_running, 0);
|
||||
pthread_detach(pthread_self());
|
||||
+ exit(1);
|
||||
+
|
||||
return NULL;
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
||||
Reference in New Issue
Block a user