Fix context updates (#20416)
Fix condition to remove context from the hub queue
Stelios Fragkakis committed
Jun 5, 2025 at 00:37 UTC
80fde6cd87512f800ac3f4b0596a81ddd1940c30
1 file changed
+7
-6
src/database/contexts/rrdcontext-queues.c
+7
-6
@@ -189,11 +189,6 @@ void rrdcontext_dispatch_queued_contexts_to_hub(RRDHOST *host, usec_t now_ut) {
189
const DICTIONARY_ITEM *item = dictionary_get_and_acquire_item(host->rrdctx.contexts, string2str(rc->id));
190
bool do_it = dictionary_acquired_item_value(item) == rc;
191
192
- if(do_it) {
193
- worker_is_busy(WORKER_JOB_DEQUEUE);
194
- rrdcontext_del_from_hub_queue(rc, true);
195
- }
196
-
192
spinlock_unlock(&host->rrdctx.hub_queue.spinlock);
193
194
if(item) {
@@ -249,12 +244,18 @@ void rrdcontext_dispatch_queued_contexts_to_hub(RRDHOST *host, usec_t now_ut) {
244
else
245
rrdcontext_unlock(rc);
246
}
247
+ else
248
+ do_it = false;
249
}
250
251
dictionary_acquired_item_release(host->rrdctx.contexts, item);
252
}
256
-
253
spinlock_lock(&host->rrdctx.hub_queue.spinlock);
254
+
255
+ if(do_it) {
256
+ worker_is_busy(WORKER_JOB_DEQUEUE);
257
+ rrdcontext_del_from_hub_queue(rc, true);
258
+ }
259
}
260
spinlock_unlock(&host->rrdctx.hub_queue.spinlock);
261