-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use thread-local var in coroutine & drop superfluous CpuBoundWork
usage
#10140
Conversation
IfwApiCheckTask
: Drop superfluous CpuBoundWork
usageCpuBoundWork
usage again
I'm not really sure about completely dropping the use of 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 icinga2/lib/methods/pluginchecktask.cpp Lines 51 to 53 in 4c6b93d
At the end, this callback will end up here: Lines 1189 to 1196 in 4c6b93d
|
a88f2e1
to
0aa76ff
Compare
1ec4c04
to
e866554
Compare
e866554
to
eaf923d
Compare
eaf923d
to
1f3d7da
Compare
1f3d7da
to
04e085c
Compare
04e085c
to
e24511d
Compare
Regarding the individual commits and their messages:
|
…global thread pool
e24511d
to
74009f0
Compare
CpuBoundWork
usage againCpuBoundWork
usage
Checkable::ExecuteCommandProcessFinishedHandler
has been utilised in an erroneous manner. Specifically, the variable is defined asthread_local
, yet the callback is executed by a different thread than the one that sets the actual callback, consequently resulting in the actual execute command handler being never called. To address this issueIfwApiCheckTask
uses thread-local variable in coroutine #10144, several functions have been altered to ensure thread safety, and the check results handlers are now executed correctly even from within a coroutine. Apart from that, in all instances where theCpuBoundWork
class was utilised, they just wasted costly semaphores, as they were either used to decode JSON responses or process check results, thereby impacting the functionality of the primary components, such as RPC and HTTP connections, that are more crucial than generating a dumb windows check result and processing countless, seemingly inconsequential boost signals. Consequently, this commit eliminates also all instances ofCpuBoundWork
class withinIfwApiCheckTask
, and delegates the process check result handling (as suggested in Don't use thread-local var in coroutine & drop superfluousCpuBoundWork
usage #10140 (comment)) to the global non-I/O thread pool instead.fixes #10144