Files
errors.bitreport.pt/ingest-api/src
David Santos 6c22dc8bb9
CI / Test ingest-api (push) Has been cancelled
CI / Test api (push) Has been cancelled
CI / Lint and typecheck admin-ui (push) Has been cancelled
CI / Validate Docker build (push) Has been cancelled
ingest-api: serialize idempotent ingest to fix SQLSTATE 23000 races
Concurrent POSTs with the same Idempotency-Key could pass the initial
SELECT and collide on INSERT into er_ingest_idempotency (unique on
ingest_key_id + idempotency_key), surfacing ER_DUP_ENTRY and risking
duplicate occurrences. Acquire a per-key MySQL named lock before the
idempotency read; on duplicate insert, roll back and replay the stored
response. Document 503 idempotency_busy when GET_LOCK times out.

Adds an integration test for parallel identical idempotent requests (BIT-2530).

Made-with: Cursor
2026-04-12 10:34:15 +00:00
..