remove the status file spinlock to avoid deadlocks (#20205)
Costa Tsaousis committed
Apr 29, 2025 at 13:09 UTC
2b74680e13eaeb2bf2576354e3bad90cb539f978
2 files changed
-5
src/daemon/status-file.c
-4
@@ -46,7 +46,6 @@ ENUM_STR_DEFINE_FUNCTIONS(DAEMON_OS_TYPE, DAEMON_OS_TYPE_UNKNOWN, "unknown");
46
47
static DAEMON_STATUS_FILE last_session_status = {
48
.v = 0,
49
- .spinlock = SPINLOCK_INITIALIZER,
49
.fatal = {
50
.spinlock = SPINLOCK_INITIALIZER,
51
},
@@ -54,7 +53,6 @@ static DAEMON_STATUS_FILE last_session_status = {
53
54
static DAEMON_STATUS_FILE session_status = {
55
.v = STATUS_FILE_VERSION,
57
- .spinlock = SPINLOCK_INITIALIZER,
56
.fatal = {
57
.spinlock = SPINLOCK_INITIALIZER,
58
},
@@ -721,7 +719,6 @@ static void daemon_status_file_refresh(DAEMON_STATUS status) {
719
usec_t now_ut = now_realtime_usec();
720
721
dsf_acquire(session_status);
724
- spinlock_lock(&session_status.spinlock);
722
723
#if defined(OS_LINUX)
724
session_status.os_type = DAEMON_OS_TYPE_LINUX;
@@ -839,7 +836,6 @@ static void daemon_status_file_refresh(DAEMON_STATUS status) {
836
simple_pattern_free(sqlite_pattern);
837
}
838
842
- spinlock_unlock(&session_status.spinlock);
839
dsf_release(session_status);
840
}
841
src/daemon/status-file.h
-1
@@ -32,7 +32,6 @@ typedef enum {
32
ENUM_STR_DEFINE_FUNCTIONS_EXTERN(DAEMON_OS_TYPE);
33
34
typedef struct daemon_status_file {
35
- SPINLOCK spinlock;
35
uint32_t v; // the version of the status file
36
37
char version[32]; // the netdata version