icinga2 icon indicating copy to clipboard operation
icinga2 copied to clipboard

/v1/actions: run only one action per object at the same time

Open Al2Klimov opened this issue 2 years ago • 4 comments

so that actions on the same object don't disturb or even deadlock each other.

fixes #9916 closes #9924

@ymartin-ovh What about this idea of mine? And if yes, does it actually fix your problem?

Al2Klimov avatar Dec 08 '23 15:12 Al2Klimov

so that actions on the same object [...] deadlock each other

I doubt that would work out: Within Checkable::ProcessCheckResult(), there are three places where the ObjectLock on the checkable is released. As the ObjectLock is a recursive mutex, if you call that while holding one on the same object externally, these unlock operations effectively do nothing anymore. So this PR might actually even introduce new deadlocks.

julianbrost avatar Dec 11 '23 08:12 julianbrost

Would you prefer a separate mutex?

Al2Klimov avatar Dec 11 '23 09:12 Al2Klimov

@Al2Klimov I don't know if it will fix my issue. But, when your PR is ready, I can build Icinga2 with your diff to check.

ymartin-ovh avatar Dec 11 '23 09:12 ymartin-ovh

Hello

I tested your proposal and I still experience deadlock on Icinga2 API with this. Have the issue twice last friday and today.

I still have two concurrent addcomment operations

all-threads-backtraces.txt lock-traces.txt

Regards

ymartin-ovh avatar Jan 15 '24 10:01 ymartin-ovh