mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
Two task creates for the same project/HEAD can race to populate the conventions cache; the loser's INSERT fails the partial-unique index with IntegrityError. A bare session.add + flush poisons the shared session (the task-create transaction rides the same session), so every subsequent op raises 'this session is in error state' and task creation crashes. Run the INSERT in a savepoint (begin_nested) and swallow the IntegrityError: only the savepoint rolls back, the outer transaction stays usable, and the winner's row satisfies the next _cache_get.