You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test parallel connected-app writes across two collab replicas #381
The #229 fix serializes writes with a per-document lock and waits until the save commits (hocuspocusApply.tswithDocumentLock). The lock lives in one process. Production runs two hocuspocus-server replicas behind HOCUSPOCUS_INTERNAL_URL (docker-compose.prod.yml), so two parallel writes to one cold document can reach two appliers with two locks. The clean result in #229 was measured on one process only. Writes in sequence are safe, because a cold 200 waits for its row.
What to do
Measure before changing anything. Run two collab processes on two ports, the way #226 tested two replicas. Send five parallel edit_blocks calls to one section of a cold document with the same rev, split across both processes. Then read the document.
Acceptance
The result is posted here: the final text, and the answer each call got.
If exactly one write applies and the rest answer a conflict or busy, close this issue.
If text is lost or doubled, post the failure and propose the smallest fix here before building it.
Activity
HMarzban commentedon Oct 15, 2026
Related issues
edit_blocksand the content API PATCH share one apply lock inhocuspocusApply.ts. A RFC: should the content API support a write precondition? #161If-Matchwould face the same two-replica limit.Cross-link review, 2026-10-15. Generated by Claude Code