Improve MonitorEventQueue performance for large workloads
On systems with large numbers of registered hosts (20-50,000) there are cases when synchronization events may trigger large volume of entries landing in the katello_events table (40,000+ rows).
The majority of these rows are import_host_applicability events that need to be processed. This processing can often take hours and sometimes an entire day.
Due to load induced in processing all these events, there are times when foreman-tasks gets overloaded and may stop processing entirely and the queue ceases to drain.
We need to optimize the processing time of this queue of events to ensure they can be worked through in a faster manner than is being done now.
Some analysis has taken place that shows that a good portion of the work going through the katello_events table entries is SELECTS/INSERTS/UPDATES to the dynflow_steps table which can often take 100-300ms or more. We may update the routine to reduce this and perform other changes to make this task perform better.
Fixes #24576 - improve Event Queue performance
previosly the event was processed in the task, requiring the task
to be notified for each and every event. With a lot of hosts,
this could be 10s of thousands of events. The act of notifying
the task, ends up reducing performance for not much benefit.
This changes it to process the event within the poller thread,
rather than the main task