gastownhall/beads · error

commit is_blocked recompute: %w

Error message

commit is_blocked recompute: %w

What it means

RecomputeAllBlockedOnConn wraps tx.Commit failure as "commit is_blocked recompute: <cause>". The recompute succeeded inside the transaction but the commit did not land, so all in-transaction changes are discarded after the implicit rollback. If the cause is a serialization/lock conflict, a retry is appropriate; if it is a connection loss, the transaction outcome may be uncertain.

Source

Thrown at internal/storage/versioncontrolops/blocked_recompute.go:81

// proxied-server plane, whose every other commit (uow.Tx.Commit) is likewise
// unauthored; a store that has a configured committer identity passes it.
//
// The returned count is meaningful even alongside a non-nil error from the
// staging step: the rows WERE corrected in the working set, only the history
// entry failed, and a caller that reported 0 there would be lying about the
// database it is looking at.
func RecomputeAllBlockedOnConn(ctx context.Context, conn BlockedRecomputeConn, author string) (int64, error) {
	tx, err := conn.BeginTx(ctx, nil)
	if err != nil {
		return 0, fmt.Errorf("begin is_blocked recompute: %w", err)
	}
	changed, err := GuardedRecomputeAllBlockedInTx(ctx, tx)
	if err != nil {
		_ = tx.Rollback()
		return 0, err
	}
	if err := tx.Commit(); err != nil {
		return 0, fmt.Errorf("commit is_blocked recompute: %w", err)
	}
	if changed > 0 {
		if err := StageAndCommit(ctx, conn, BlockedRecomputeStagedTables(), BlockedRecomputeCommitMsg, author); err != nil {
			return changed, err
		}
	}
	return changed, nil
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Retry the whole RecomputeAllBlockedOnConn call with backoff — the operation is transactional and safe to re-run
  2. Check the wrapped cause for deadlock/conflict messages and stagger competing writers
  3. Verify connection stability (timeouts, keepalives) for long transactions
  4. If uncertain-commit errors appear, verify the resulting rows before retrying

Example fix

// before
n, err := vcops.RecomputeAllBlockedOnConn(ctx, conn, "agent")
if err != nil { return err }
// after
n, err := vcops.RecomputeAllBlockedOnConn(ctx, conn, "agent")
if err != nil {
	if strings.Contains(err.Error(), "commit is_blocked recompute") {
		return retryWithBackoff(func() error {
			_, e := vcops.RecomputeAllBlockedOnConn(ctx, conn, "agent"); return e
		})
	}
	return err
}
Defensive patterns

Strategy: retry

Try / catch

_, err := vcops.RecomputeAllBlockedOnConn(ctx, conn, author)
if err != nil {
	if strings.Contains(err.Error(), "commit is_blocked recompute") {
		// transaction rolled back; whole op is safe to retry
		return retryWithBackoff(3, func() error {
			_, e := vcops.RecomputeAllBlockedOnConn(ctx, conn, author); return e
		})
	}
	return err
}

Prevention

When it happens

Trigger: RecomputeAllBlockedOnConn when tx.Commit fails: connection lost mid-transaction, commit deadlock/conflict with another writer, or server-side rejection at commit time.

Common situations: Network partition during a long recompute; competing writers committing to the same is_blocked rows; server restart mid-transaction.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/994890d58d761540. Report an issue: GitHub.