Description
When two deletion jobs for the same resource are picked up simultaneously by different workers, the second delete job might fail with an error message like:
Attempt to delete object did not result in a single row modification (Rows Deleted: 0, SQL: DELETE FROM "organizations" WHERE ("id" = 4))
If the jobs are picked up sequentially (or with enough delay), the second deletion job results in a no-op, as the organization cannot be loaded.
Steps to Reproduce
Introduce a sleep in the organization_delete method within the database transaction block.
Trigger two delete requests for the same organization.
Start multiple worker processes/threads to ensure concurrent job execution.
Current Behavior
The later executed job fails with a single row modification error.
Expected Behavior
The second deletion job should result in a no-op and not fail.
Description
When two deletion jobs for the same resource are picked up simultaneously by different workers, the second delete job might fail with an error message like:
If the jobs are picked up sequentially (or with enough delay), the second deletion job results in a no-op, as the organization cannot be loaded.
Steps to Reproduce
Introduce a sleep in the organization_delete method within the database transaction block.
Trigger two delete requests for the same organization.
Start multiple worker processes/threads to ensure concurrent job execution.
Current Behavior
The later executed job fails with a
single row modificationerror.Expected Behavior
The second deletion job should result in a no-op and not fail.