Repository navigation
fix: fixes more race conditions with transactions - #4164
Conversation
DanRibbens
left a comment
There was a problem hiding this comment.
From what I can tell this is exactly what we need having that req.transactionIDPromise. I would like to introduce a test suite called database under which we can add a some transaction specific int cases using just the local api that:
- multiple operations from one req async
- multiple operations from one req sync
- one successful operation, call another that fails and expect the rollback of the first operation
|
I will try to write a test suite that tests this, yes. I didn't do that yet, because I am not quite sure ho exactly to accomplish it. But I'll give it a shot tomorrow! |
|
Hey @diesieben07, I can probably sink a few mins in here and have it done. If you don't have this started, I can jump on it. Let me know! |
|
@DanRibbens I appreciate the help, yes please go ahead! Unfortunately I did not have time to work on this yesterday and today and I'll be busy on the weekend, too. |
|
@diesieben07 Thank you so much for all the help with transaction stability! |
Description
This pull request fixes two race conditions with transactions:
initTransaction, which can lead two operations to both initialize a transaction and both think they are in charge of committing it.getEntityPolicies. These operations did not start a transaction, and so the many operations thatgetEntityPolicieskicks off concurrently were racing for who starts and commits the transaction.Type of change
Checklist: