fix(push): Phase 4 — SELECT FOR UPDATE on branch row during push
Two concurrent pushes to the same branch both read the same head_commit_id, both pass the fast-forward check, and the last session.commit() wins — silently leaving the first push's commits unreachable from the branch ref.
Fix: add .with_for_update() to the MusehubBranch SELECT in wire_push_stream (step 9, branch pointer update). PostgreSQL row-level exclusive lock serializes concurrent pushes so each one sees the head left by the previous.
2 new tests in test_wire_push_stream.py (Phase 4): - sequential pushes both advance branch correctly - non-FF push rejected after branch is concurrently advanced
sha256:9dcf8d543d11b8ffcdabb119ff3c6f44dd588bb8bc23515820f5550a2b85599b
sha
+2
~1
symbols
sha256:bda90ea0770774497237b8fe62c71b51c4275307e442271c26f96bd26d6cf4bc
snapshot
+2
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes
3 symbols
+
test_phase4_non_ff_push_rejected_after_concurrent_advance
function
async_function test_phase4_non_ff_push_rejected_after_concurrent_advance L1437–1505
+
test_phase4_sequential_pushes_both_advance_branch
function
async_function test_phase4_sequential_pushes_both_advance_branch L1367–1433
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:9dcf8d543d11b8ffcdabb119ff3c6f44dd588bb8bc23515820f5550a2b85599b --body "your comment"
No comments yet. Be the first to start the discussion.