Current Behavior
If we receive multiple parallel updates for the some instance, but different scopes, a deadlock can occur.
- request received to update instance A, scope B.
- Within a transaction, we select the row with an update lock
- We determine the change in size of that context entry, but then need to check the total quota usage for the instance - so do a query for all scopes under instance A
If a second update comes in parallel for instance A, scope C, it will achieve a lock on that row. That then blocks the quota check off the first request. Both requests are now deadlocked.
Expected Behavior
Not to deadlock
Steps To Reproduce
Drive multiple requests to different context scopes in parallel.
Environment
- FlowFuse version:
- Node.js version:
- npm version:
- Platform/OS:
- Browser:
Linked Customers
- Customer name and/or link to HubSpot contact
Current Behavior
If we receive multiple parallel updates for the some instance, but different scopes, a deadlock can occur.
If a second update comes in parallel for instance A, scope C, it will achieve a lock on that row. That then blocks the quota check off the first request. Both requests are now deadlocked.
Expected Behavior
Not to deadlock
Steps To Reproduce
Drive multiple requests to different context scopes in parallel.
Environment
Linked Customers