Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2k stars 574 forks source link

Don't use thread-local var in coroutine & drop superfluous `CpuBoundWork` usage #10140

Closed yhabteab closed 6 days ago

yhabteab commented 1 month ago

fixes #10144

julianbrost commented 1 month ago

I'm not really sure about completely dropping the use of CpuBoundWork in IfwApiCheckTask without any replacement, in particular for calling Checkable::ProcessCheckResult(). After all, that function does quite a lot, may lock different objects and so on.

An alternative could be moving this to the other thread pool, i.e. do it the same way how it's done to process regular check results. It uses the following callback where ProcessFinishedHandler() calls ProcessCheckResult() internally: https://github.com/Icinga/icinga2/blob/4c6b93d61775ff98fc671b05ad4de2b62945ba6a/lib/methods/pluginchecktask.cpp#L51-L53 At the end, this callback will end up here: https://github.com/Icinga/icinga2/blob/4c6b93d61775ff98fc671b05ad4de2b62945ba6a/lib/base/process.cpp#L1189-L1196

julianbrost commented 4 weeks ago

Regarding the individual commits and their messages: