Process metric callbacks from the main-loop thread

This avoids the callbacks from being processed on the worker thread
spawned by Civetweb. It fixes data race issues with lookups involving
global variables, amongst other threading issues.
This commit is contained in:
Tim Wojtulewicz 2024-07-26 11:12:54 -07:00
parent 9d9cc51e9d
commit 7ac7ce1d2b
10 changed files with 130 additions and 11 deletions

View file

@ -5883,6 +5883,13 @@ export {
type MetricVector : vector of Metric;
type HistogramMetricVector : vector of HistogramMetric;
## Maximum amount of time for CivetWeb HTTP threads to
## wait for metric callbacks to complete on the IO loop.
const callback_timeout: interval = 5sec &redef;
## Number of CivetWeb threads to use.
const civetweb_threads: count = 2 &redef;
}
module GLOBAL;