Only notes.Edit takes the per-note edit lock; other writers of the same notes do not #197

Open
opened 2026-10-05 21:43:27 +00:00 by mathias · 0 comments
Owner

Source: PR #194 review round 2 (non-blocking 3), 2026-10-05. This predates #194.

The comment on the edit lock says other writers (brain-fix, brain-enrich, the pipeline, brain_update, brain_tunnel, promote) write the same tree. But notes.Edit is the only flock user in the repo. So a brain_edit and, for example, a brain_update or a pipeline revision of the same note do not exclude each other, across pods or within one. Writes are atomic per file, so the result is a lost update, not a torn file.

Options:

  • Route every note writer through the same lock (notes.flockFile moved into brainfs or a shared package).
  • Or document that only brain_edit is serialised and that last-writer-wins applies to everything else.

Related: #196 (the snapshot outside the lock).

Rollout note from the same review: during the RollingUpdate that deploys #194, an old pod (which unlinks after unlocking) and a new pod do not exclude each other. From the following rollout on, the lock holds.


Created via git-mcp on behalf of @mathias

**Source:** PR #194 review round 2 (non-blocking 3), 2026-10-05. This predates #194. The comment on the edit lock says other writers (brain-fix, brain-enrich, the pipeline, brain_update, brain_tunnel, promote) write the same tree. But `notes.Edit` is the only flock user in the repo. So a `brain_edit` and, for example, a `brain_update` or a pipeline revision of the same note do not exclude each other, across pods or within one. Writes are atomic per file, so the result is a lost update, not a torn file. **Options:** - Route every note writer through the same lock (`notes.flockFile` moved into brainfs or a shared package). - Or document that only `brain_edit` is serialised and that last-writer-wins applies to everything else. **Related:** #196 (the snapshot outside the lock). **Rollout note from the same review:** during the RollingUpdate that deploys #194, an old pod (which unlinks after unlocking) and a new pod do not exclude each other. From the following rollout on, the lock holds. --- _Created via git-mcp on behalf of @mathias_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/hyperguild#197