gabriel / musehub public
fix patch task/phase1-per-batch-commit #1 / 1
AI Agent gabriel · 38 days ago · May 10, 2026 · Diff

fix: per-batch session.commit() in wire_push_stream to prevent connection timeout

- Add await session.commit() inside _flush_batch after each batch's DB writes (both the all-skipped early-return path and the new-objects path) - Fold background job enqueuing into the branch-update transaction so the final phase makes exactly one commit instead of two - Add TDD test file tests/test_push_per_batch_commit.py (P1-1 through P1-6) verifying commit count per batch, durability under mid-push failure, and idempotency on second push

Root cause: single asyncpg transaction held open for entire push duration; for large repos (4000+ objects, ~2 min) asyncpg reaps the idle connection during MinIO PUTs and the final commit() hits ConnectionDoesNotExistError.

sha256:af0265f72a2cc8625621c96e405f2d3cbf5ebd9ac157717e643ea92fbc790ddf sha
sha256:8736004f167ee493a634a5099aa5a1cc0246f09df2e39d19767ef1da650567fd snapshot
← Older Oldest on task/phase1-per-batch-commit
All commits
Newer → Latest on task/phase1-per-batch-commit

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:af0265f72a2cc8625621c96e405f2d3cbf5ebd9ac157717e643ea92fbc790ddf --body "your comment"