-
-
Notifications
You must be signed in to change notification settings - Fork 79
WIP Add locks to protect concurrent rules edition #604
base: develop
Are you sure you want to change the base?
Conversation
bb2f238
to
4f01cdf
Compare
Hi, @btry. The source to EntityRuleEditionException is correct?
|
Hi @ingluife yes this is correct. If you read the PR to see the purpose is to ensure atomicity in some critical blocks of code (GLPI does not provides transactions yet, this is on its way) |
What do you mean with "modification of rules"? or in Which scenario this happens? |
Consider there are 2 parallel executions to add an invitation. Due t o the lack of atomicity (transaction) for now, one process may create a rule to create computers in an entity while the other may do the same (with tthe same destination entity). In such scenario here is what might happen
We finally have 2 rules doing the same (destination entity = 1) but we require to have only one. Same type of scenario when removing criterias. If no criteria exists the rule is deleted. But this is risky if an other process tries to re-use the rule because it needs it. We need locks to prevent this. The failure in unit tests you encouteered may be related to the lack of locks. Also I found il my local database duplicates rules making some tests fail. That's why I asked you if you also had duplicates rows (yesterday ?) |
4f01cdf
to
d4af333
Compare
14c4da6
to
0157ca9
Compare
d7381af
to
5d4fdd3
Compare
5d4fdd3
to
d968de6
Compare
The purpose is to avoid simultaneous modification of rules in some specific cases Signed-off-by: Thierry Bugier <[email protected]>
d968de6
to
3a14404
Compare
Experimental - Add locks to protect concurrent rules edition
The purpose is to avoid simultaneous modification of rules in some specific cases.
Changes description
Checklist
Please check if your PR fulfills the following specifications:
Estimated time
References
Closes #N/A
Related #N/A
Depends on #N/A