Project

General

Profile

Actions

Bug #25876

closed

Race condition on removing multiple organizations simultaneously

Added by Ondřej Pražák about 6 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Description of problem:
Hitting db constraints when trying to delete multiple organizations at the same time.

LANG=en_US.UTF-8 hammer -v -u admin -p changeme organization delete --name="\xe9\xbe\xa3\xe9\xbc\x84\xe8\xbe\xbd\xe6\x98\xb4"

Task ef128feb-1d73-4161-81c8-731d6b64789a planned: 0.0/1, 0%, elapsed: 00:00:00
Task ef128feb-1d73-4161-81c8-731d6b64789a running: 0.9090909090909091/1, 90%, 0.4/s, elapsed: 00:00:02
Task ef128feb-1d73-4161-81c8-731d6b64789a error: 0.9545454545454546/1, 95%, 0.2/s, elapsed: 00:00:04
Task ef128feb-1d73-4161-81c8-731d6b64789a error: 0.9545454545454546/1, 95%, 0.2/s, elapsed: 00:00:04
Error: PG::ForeignKeyViolation: ERROR: update or delete on table "taxonomies" violates foreign key constraint "taxable_taxonomies_taxonomy_id_fk" on table "taxable_taxonomies"
DETAIL: Key (id)=(28) is still referenced from table "taxable_taxonomies".
: DELETE FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') AND "taxonomies"."id" = $1

Steps to Reproduce:
Try to delete multiple organizations at the same time. Not reproducible each time due to the nature of the bug.

Actions

Also available in: Atom PDF