Skip to content

Registry race: concurrent uploads of the same file need a regression test (F1) #191

Closed

Description

@amar-python

Raised by the product owner on 4 Nov 2026 as "F1: registry race" in the code review feedback. Not reproduced in this session.

Label clash. Issue #178 is also labelled "F1" and is a different defect (distinct rows discarded as duplicates). Keep both; the labels are not interchangeable.

What the code shows (verified at c7bebd1)

  • Migration alembic/versions/0002_registry_unique.py adds UNIQUE (file_hash) and UNIQUE (file_name) on csv_files. These constraints enforce the registry invariant at the database.
  • The check-then-insert in the upload path is not verified as race-free by any test in this session.

Proposed

  • Add a concurrency regression: two simultaneous uploads of the same file, and two uploads with the same name and different content.
  • Assert one registry row, and an attributable rejection for the second request, with no partial state left behind.

Done when

  • The concurrency test passes on the candidate build, with its run output (passed, failed, skipped) attached.
  • The same test fails when the file_hash UNIQUE constraint is removed (mutation check).

Generated by Claude Code

Activity

  1. amar-python commented on Nov 9, 2026

    @amar-python
    OwnerAuthor

    Fixed in #202 (merged as 203c8ae).


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions