Skip to content

Zarr queue: claim_next docstring overstates atomicity #1142

Closed

Description

@neuromechanist

claim_next in scripts/zarr/zarr_queue.py does a SELECT followed by an UPDATE without an explicit transaction, while its docstring says "Atomic under the connection's write lock". Two concurrent callers could claim the same row.

Not currently reachable: hallu-zarr.sh takes an exclusive flock and is the only caller, so the drain is serialized by construction. The risk is entirely latent, and the docstring is the actual defect: it states a guarantee the code does not provide, so a future second caller would be added on a false premise.

Either wrap the claim in BEGIN IMMEDIATE and make the docstring true, or correct the docstring to say the serialization comes from the caller's flock.

Found during the v0.9.9 release review (#1137).

Activity

  1. added a commit that references this issue on Sep 3, 2026
    1867c27
  2. neuromechanist commented on Sep 3, 2026

    @neuromechanist
    ContributorAuthor

    Fixed in #1221 (dev commit 1867c27); ships with the next dev to main release.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions