Leverage existing locking mechanism to prevent race condition in group member removal
What does this MR do and why?
As per the issue 367510, it was possible to remove the last person in the group and to have a situation where the group has no owner. We have a check in the existing code base where we confirm that the member being deleted is not the last member of the group but it proved to be insufficient in case of a race condition.
With the current changes, leveraging ExclusiveLeaseHelpers's locking mechanism, will ascertain that the last member of the group is not deleted.
How to set up and validate locally
- The issue can be reproduced using this script.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #367510 (closed)
Edited by Mansoor Khan