diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2022-07-14 13:29:44 +0300 |
---|---|---|
committer | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2022-07-14 13:29:44 +0300 |
commit | e81f2ff3180bd7381664a46ec14a7ca8c7661e04 (patch) | |
tree | 5a5ba1343a1ce7cbc9da38db0f858feddfc3794a | |
parent | 2bf0bfb268917ead34776c2e4c68b10554956b24 (diff) |
Make sure claim id is valid
-rw-r--r-- | database/rrdcontext.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/database/rrdcontext.c b/database/rrdcontext.c index f7f6502283..639fac68e9 100644 --- a/database/rrdcontext.c +++ b/database/rrdcontext.c @@ -2176,8 +2176,8 @@ void *rrdcontext_main(void *ptr) { worker_is_busy(WORKER_JOB_QUEUED); usec_t dispatch_ut = rrdcontext_queued_dispatch_ut(rc, now_ut); - - if(unlikely(now_ut >= dispatch_ut)) { + char *claim_id = is_agent_claimed(); + if(unlikely(now_ut >= dispatch_ut) && claim_id) { worker_is_busy(WORKER_JOB_CHECK); rrdcontext_lock(rc); @@ -2190,7 +2190,7 @@ void *rrdcontext_main(void *ptr) { // prepare the bundle to send the messages char uuid[UUID_STR_LEN]; uuid_unparse_lower(*host->node_id, uuid); - bundle = contexts_updated_new(host->aclk_state.claimed_id, uuid, 0, now_ut); + bundle = contexts_updated_new(claim_id, uuid, 0, now_ut); } #endif // update the hub data of the context, give a new version, pack the message @@ -2229,6 +2229,7 @@ void *rrdcontext_main(void *ptr) { else rrdcontext_unlock(rc); } + freez(claim_id); } dfe_done(rc); |