Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🤖 bug: unlocked handle writers can still replace or drop concurrent workspace-turn handle writes (#5362 follow-up)

Open
#5,432 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

Start at settleWorkspaceTurn and markWorkspaceTurnBackgroundWorkNotifyOnTerminal, then trace withWorkspaceTurnPublicationLock and the settlement callers; review refs #4926, #5362, and #5361 for locking assumptions. Done means settlement preserves an already-terminal record and attentionPolicy uses a publication-locked read-modify-write, so concurrent writes are not lost.

Written by the indexing model from the issue text.

Description

backlog

Problem

Follow-up from #5362. The owner's acceptance (markWorkspaceTurnAccepted) and a foreign explicit interrupt (interruptWorkspaceTurn) now read and write the handle under a per-handle cross-process publication lock, so neither overwrites a record the other wrote after its read.

settleWorkspaceTurn still reads the handle under the owner's in-process settlement lock only, then awaits before its upsert. If another backend's explicit interrupt writes interrupted in that window, the owner's settlement replaces it with its own terminal outcome (for example error). This is step 3 of #4926. The execution mirror stays consistent with the handle (#5361 fences the foreign mirror write), so the visible effect is a mislabeled terminal outcome, not a running/terminal mismatch.

A second unlocked writer has the same shape: markWorkspaceTurnBackgroundWorkNotifyOnTerminal writes attentionPolicy (with a new updatedAt) without the publication lock. If it lands between the owner acceptance's locked re-read and its upsert, the acceptance publishes running from the older record and the policy is lost, so the terminal background notification never fires. The same loss existed before #5362 (the acceptance then wrote back a read taken before its mirror-claim await). Found in review of #5433.

Possible fix

Take the same withWorkspaceTurnPublicationLock around settlement's read and write (keep the current record when it is already terminal) and around the attention-policy read-modify-write. The settlement path has many callers, so it needs its own review.

Refs #4926, #5362


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $10.87

Dominant language
TypeScript
Stars
2k
Forks
140
Avg merge
2h 27m
Merged PRs (30d)
873

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coder/xum

All issues in coder/xum

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.