mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-06 16:09:41 +00:00
Uses mpsc channels to process pulled scheduled jobs so that it does not block the entire alert manager to pull other jobs when there is capacity. Makes use of semaphores so that we pull the same number of jobs as the number of available workers. ### The new design is - - We spawn the same number of worker threads as the configured max concurreny env. - After pulling jobs, it sends to each worker through the mpsc channel - Each worker processes the received trigger - After the scheduler interval, the puller job checks how many workers are still available i.e. how many workers are done with processing triggers. - It only pulls the same number of jobs from db as the number of available workers at that particular time. The cycle continues. So, the scheduler pulls at max the "max concurrency" number of jobs at a time depending on the availability of worker threads.