Skip to content

Commit

Permalink
Improve ACLK sync CPU usage (netdata#18935)
Browse files Browse the repository at this point in the history
* Avoid expensive checks if we don't schedule info

* Set config to uninitialized during exit
  • Loading branch information
stelfrag authored Nov 4, 2024
1 parent 35cd0ee commit a1abfb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/database/sqlite/sqlite_aclk.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ static void aclk_synchronization(void *arg)
}
} while (opcode != ACLK_DATABASE_NOOP);
}
config->initialized = false;

if (!uv_timer_stop(&config->timer_req))
uv_close((uv_handle_t *)&config->timer_req, NULL);
Expand Down
3 changes: 3 additions & 0 deletions src/database/sqlite/sqlite_aclk_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ void aclk_check_node_info_and_collectors(void)
continue;
}

if (!wc->node_info_send_time && !wc->node_collectors_send)
continue;

if (unlikely(host_is_replicating(host))) {
internal_error(true, "ACLK SYNC: Host %s is still replicating", rrdhost_hostname(host));
replicating++;
Expand Down

0 comments on commit a1abfb1

Please sign in to comment.