GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(fileops): PR #1706's free_archive_name is check-then-act — concurrent same-second replaces can still lose a replaced version's archive · Issue #2462 · developing-today/code

id(fileops): PR #1706's free_archive_name is check-then-act — concurrent same-second replaces can still lose a replaced version's archive #2462

New issue
Copy link
New issue
Copy link
Closed
#3012
Closed
id(fileops): PR #1706's free_archive_name is check-then-act — concurrent same-second replaces can still lose a replaced version's archive#2462
#3012
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 29, 2026
Issue body actions

id(fileops): PR #1706's free_archive_name is check-then-act — concurrent same-second replaces can still lose a replaced version's archive

Finding

PR #1706 (merged, fixes #1612) made archive tag names unique for the sequential case: free_archive_name (pkgs/id/src/fileops.rs:107 on current main 5a34fa70) loops store.tags().get(candidate) until it finds a free {name}.archive.{ts} name, and the caller only afterwards claims it with tags().set. The check and the claim are two separate awaited store operations with nothing serialising them, and iroh-blobs tags().set is an unconditional write — the same check-then-act shape as #2363 (the upload uniquifier), at a different site.

Interleaving that still loses data, for two concurrent replaces of the same name in the same second (rename/copy at fileops.rs:260/:346, put, or the web save path via archive_original_tag at web/routes.rs:2209, called at routes.rs:1261):

  1. A reads current hash v1, free_archive_name returns doc.archive.{ts}.
  2. B reads current hash v1, free_archive_name also returns doc.archive.{ts} (A has not set it yet).
  3. A sets doc.archive.{ts} = v1, then sets doc = v2.
  4. B sets doc.archive.{ts} = v1 (same value, harmless), then sets doc = v3.

v2 was live and is now referenced by no tag: it was never archived, so it lost exactly the archive/GC protection #1612 exists to provide. The PR's regression tests (fileops.rs:464 same_second_archives_never_overwrite) are sequential — each archive is fully set before the next name is resolved — so they cannot see this window.

Evidence

  • PR: id(fileops): unique archive tag names so same-second replaces never overwrite (#1612) #1706 — merge d29f867ca765f1e89025d9c499ac25d1e46ffa2b, head commits 5fb1d2cf, a3be7eeb.
  • Current main 5a34fa70: free_archive_name at pkgs/id/src/fileops.rs:107-118 (get-loop, returns unclaimed name); claim sites archive_existing (fileops.rs:173, set follows at its end), rename (:260), copy (:346), web archive_original_tag (web/routes.rs:2209, used at :1261).
  • No lock/mutex serialises these paths: grep Mutex/lock pkgs/id/src/web/routes.rs shows only the unrelated local_events lock; FileOps holds no lock field.

Why it matters

The archive tag is the only reference keeping a replaced version alive for GC. The sequential same-second collision #1612 reported is fixed, but the concurrent case — two clients/CLI processes against one store, or a web save racing a rename — silently drops a version's archive with no error anywhere.

Acceptance criteria

  • Two concurrent same-name replaces within one second both leave an archive tag pointing at their respective replaced versions (a regression test that interleaves the two free_archive_name resolutions before either claim, or an equivalent concurrency test, fails before and passes after).
  • The claim is made atomic or serialised (e.g. a set-if-absent claim loop inside free_archive_name's callers, or a per-store lock around resolve+claim) at all three call sites including the web layer's archive_original_tag.
  • Sequential behaviour and name shape unchanged: uncontested name is exactly {name}.archive.{ts}; existing archive_name_tests and protocol archive tests still pass (in CI).

Found by pr-diff-review lane B reviewing PR #1706. Sibling, not duplicate: #2363 covers the upload-name uniquifier in upload_handler; this is the archive-name path from #1612.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/pr-diff-reviewFiled by the pr-diff-review job
    priority/lowNice to have; do when convenient
    queue/queuedHas a queued queue task
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    Contributor
    More actions

    CODE-1259

  3. dezren39
    added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 29, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: pr-diff-review-b
    • Session / ID: pr-diff-review-b cron run 2026-10-29 18:18 CDT
    • Found via: PR id(fileops): unique archive tag names so same-second replaces never overwrite (#1612) #1706 diff review (lane B, developing-today/code)
    • Task: Filed the free_archive_name check-then-act race: resolve (tags().get loop, fileops.rs:107) and claim (tags().set) are separate awaited ops with no serialisation, so two concurrent same-second replaces can both resolve the same archive name and the second replace's predecessor version is never archived. PR id(fileops): unique archive tag names so same-second replaces never overwrite (#1612) #1706's tests are sequential only.
    • Expectation: effort s; done when resolve+claim is atomic/serialised at all call sites (incl. web archive_original_tag) with an interleaving regression test, sequential name shape unchanged.
    • Links: id(fileops): PR #1706's free_archive_name is check-then-act — concurrent same-second replaces can still lose a replaced version's archive #2462 id(fileops): PR #1706's free_archive_name is check-then-act — concurrent same-second replaces can still lose a replaced version's archive #2462 · PR id(fileops): unique archive tag names so same-second replaces never overwrite (#1612) #1706 id(fileops): unique archive tag names so same-second replaces never overwrite (#1612) #1706 · id(fileops): archive tags collide within one second — a second replace of the same name silently overwrites the first replace's archive #1612 (sequential case, closed) · id(web): PR #1696's upload-name uniquifier is check-then-act — concurrent same-name uploads still silently un-name the first #2363 (sibling check-then-act, upload uniquifier)
  5. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 31, 2026
  7. 22 remaining items

  8. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Oct 31, 2026
  9. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    agent-note:v1
    event: parked
    task: 4353 (lane C)
    reason: CI pending on PR 3012 — no PR workflow run has started ~30 min after open (fleet runner backlog). Codex review on head 0380366: no findings. Diff verified in-scope (pkgs/id/src/fileops.rs + pkgs/id/src/web/routes.rs). Resume: CI green -> merge PR 3012 -> close this issue.

  10. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 31, 2026
  11. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up (resume)

    • Agent: queue worker (repo-worker-code), lane B shift
    • Session / ID: queue task 4353
    • Found via: queue claim (resume from parked awaiting_ci)
    • Task: id(fileops) atomic archive-name claim (id(fileops): PR #1706's free_archive_name is check-then-act — concurrent same-second replaces can still lose a replaced version's archive #2462) — PR id(fileops): claim archive names atomically (resolve+set under one lock) (#2462) #3012 @ 0380366. Fresh revalidation: PR open + mergeable, head matches, Codex review completed on this exact head with zero findings (codex-review-state:v1, has_any_findings=false), 0 unresolved threads, diff is exactly the two in-scope files (+113/−34). No CI workflow has started on this branch in ~1h (fleet runner backlog — infra, not the change). Per the standing merge directive I am verifying the change first-hand instead of parking a third time: targeted cargo tests re-running on the laptop this shift; merge follows only if they pass.
  12. dezren39
    added a commit that references this issue on Oct 31, 2026

    Merge pull request #3012 from developing-today/queue/4353-2462-archiv…

    ab55f3c
  13. dezren39
    closed this as completedin #3012on Oct 31, 2026
  14. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (fix merged)

    • Agent: queue worker (repo-worker-code), lane B shift
    • Session / ID: queue task 4353
    • Found via: queue claim (resume)
    • Task: id(fileops) atomic archive-name claim — PR id(fileops): claim archive names atomically (resolve+set under one lock) (#2462) #3012 merged (ab55f3c256cd53cb3cbab25ccc8eb61b2afc768b), this issue closed by the merge.
    • Verification (first-hand this shift): Codex review completed on head 0380366 with zero findings and 0 unresolved threads; diff is exactly the two in-scope files (+113/−34) with all three claim sites routed through claim_archive_name (fileops.rs archive_existing + rename arm, routes.rs archive_original_tag:2249); laptop cargo test --offline -p id fileops exit 0 — 3/3 archive tests pass, including the new barrier-synchronised concurrent_same_second_claims_never_collide and the pre-existing same_second_archives_never_overwrite.
    • CI note: no CI workflow ever started on this branch (~1h, fleet runner backlog — infrastructure, not the change). Merged under the standing merge directive on the strength of the laptop test verification + clean Codex review; if post-merge CI surfaces a problem in this change, fix forward.
  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 31, 2026
  16. dezren39
    added a commit that references this issue on Nov 11, 2026

    fix(id/web): create on an existing filename conflicts instead of empt…

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

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.