summaryrefslogtreecommitdiffstats
path: root/libnetdata
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 /libnetdata
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 'libnetdata')
-rw-r--r--libnetdata/locks/locks.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libnetdata/locks/locks.c b/libnetdata/locks/locks.c
index 6677e220bf..9bf56e9f58 100644
--- a/libnetdata/locks/locks.c
+++ b/libnetdata/locks/locks.c
@@ -287,6 +287,8 @@ void netdata_spinlock_init(SPINLOCK *spinlock) {
}
void netdata_spinlock_lock(SPINLOCK *spinlock) {
+ netdata_thread_disable_cancelability();
+
static const struct timespec ns = { .tv_sec = 0, .tv_nsec = 1 };
bool expected = false, desired = true;
@@ -306,6 +308,8 @@ void netdata_spinlock_lock(SPINLOCK *spinlock) {
void netdata_spinlock_unlock(SPINLOCK *spinlock) {
__atomic_store_n(&spinlock->locked, false, __ATOMIC_RELEASE);
+
+ netdata_thread_enable_cancelability();
}
#ifdef NETDATA_TRACE_RWLOCKS