summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-11-29 16:03:40 +0200
committerGitHub <noreply@github.com>2022-11-29 16:03:40 +0200
commit462988dac901e95e765cd6be2dc24a5c33595526 (patch)
tree601474721ffe5cbe7885faa1b78947ce467d2e89 /daemon
parent009029052f54224b2387e652a6a81a9887008b15 (diff)
replication fixes No 8 (#14061)
* replication requests with start_streaming=true are executed immediately upon reception, instead of being placed in the queue * disable thread cancelability while workers cleanup * remove obsolete worker from replication * multi-threaded replication with netdata.conf option to set number of replication threads * revert spinlock to mutex * separate worker and main thread worker jobs * restart the queue every 10 seconds only * use atomic for sender buffer percentage * reset the queue position after sleeping * use sender resets to sleep properly * fix condition * cleanup sender members related to replication
Diffstat (limited to 'daemon')
-rw-r--r--daemon/global_statistics.c5
-rw-r--r--daemon/static_threads.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/daemon/global_statistics.c b/daemon/global_statistics.c
index 7ac4bdfa77..53fd6c45af 100644
--- a/daemon/global_statistics.c
+++ b/daemon/global_statistics.c
@@ -2474,6 +2474,8 @@ static int read_thread_cpu_time_from_proc_stat(pid_t pid __maybe_unused, kernel_
static Pvoid_t workers_by_pid_JudyL_array = NULL;
static void workers_threads_cleanup(struct worker_utilization *wu) {
+ netdata_thread_disable_cancelability();
+
struct worker_thread *t = wu->threads;
while(t) {
struct worker_thread *next = t->next;
@@ -2483,9 +2485,10 @@ static void workers_threads_cleanup(struct worker_utilization *wu) {
DOUBLE_LINKED_LIST_REMOVE_UNSAFE(wu->threads, t, prev, next);
freez(t);
}
-
t = next;
}
+
+ netdata_thread_enable_cancelability();
}
static struct worker_thread *worker_thread_find(struct worker_utilization *wu __maybe_unused, pid_t pid) {
diff --git a/daemon/static_threads.c b/daemon/static_threads.c
index 3964fb1547..b7730bc310 100644
--- a/daemon/static_threads.c
+++ b/daemon/static_threads.c
@@ -134,7 +134,7 @@ const struct netdata_static_thread static_threads_common[] = {
#endif
{
- .name = "rrdcontext",
+ .name = "RRDCONTEXT",
.config_section = NULL,
.config_name = NULL,
.enabled = 1,
@@ -144,7 +144,7 @@ const struct netdata_static_thread static_threads_common[] = {
},
{
- .name = "replication",
+ .name = "REPLICATION",
.config_section = NULL,
.config_name = NULL,
.enabled = 1,