Issue #8912: [EPIC] Issues with the traditional tasking system
Possible race condition where task's reservations get deleted
This was something I noticed while working on #8603. I haven't actually reproduced it so it's purely theoretical.
TaskReservedResource has a cascade delete on its
ReservedResource FK, which could cause a race condition:
- Task 1 confirms that the reserved resource has no other tasks
- Task 2 reserves the resource
- Task 1 calls delete which cascades and deletes Task 2's reservations of the resource