Revert Dolt lock cleanup workaround; fix embedded Dolt open via driver retries#1389
Merged
steveyegge merged 8 commits intosteveyegge:mainfrom Jan 31, 2026
Merged
Conversation
added 8 commits
January 28, 2026 16:24
…nal reliability (steveyegge#1260)" This reverts commit d037158.
Collaborator
Author
|
Fixes #1401 |
steveyegge
approved these changes
Jan 31, 2026
Owner
steveyegge
left a comment
There was a problem hiding this comment.
Well-engineered architectural improvement from the Dolt team. Replaces fragile lock-cleanup workarounds with proper driver-level retries and connector lifecycle management. Includes bug fixes for path-doubling and context poisoning. LGTM.
groblegark
pushed a commit
to groblegark/beads
that referenced
this pull request
Jan 31, 2026
…r retries (steveyegge#1389) * Revert "fix(dolt): add lock retry and stale lock cleanup for operational reliability (steveyegge#1260)" This reverts commit d037158. * /{internal,go.mod,go.sum}: bump dolt driver, fix file after revert * /{go,internal}: fix embedded dolt * /{docs,internal}: fix path error * /go.{mod,sum}: bump driver * /{cmd,.github}: update workflows to pickup go.mod go version, fix lint error * /.github/workflows/ci.yml: add icu4 * /{cmd,internal}: fix failing tests --------- Co-authored-by: Test <[email protected]> (cherry picked from commit 2c7e2d8)
groblegark
pushed a commit
to groblegark/beads
that referenced
this pull request
Jan 31, 2026
…r retries (steveyegge#1389) * Revert "fix(dolt): add lock retry and stale lock cleanup for operational reliability (steveyegge#1260)" This reverts commit d037158. * /{internal,go.mod,go.sum}: bump dolt driver, fix file after revert * /{go,internal}: fix embedded dolt * /{docs,internal}: fix path error * /go.{mod,sum}: bump driver * /{cmd,.github}: update workflows to pickup go.mod go version, fix lint error * /.github/workflows/ci.yml: add icu4 * /{cmd,internal}: fix failing tests --------- Co-authored-by: Test <[email protected]> (cherry picked from commit 2c7e2d8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
• Migrates Beads’ embedded Dolt backend to rely on dolthub/driver’s native open retries (via Config.BackOff) instead of
Beads-side lock contention workarounds.
• Refactors embedded initialization into explicit unit-of-work connectors so filesystem locks are reliably released between
setup steps (create DB, init schema, then open the long-lived store).
• Cleans up lock-contention scaffolding/documentation that existed only to paper over the old driver behavior.
Key changes
• Embedded connector lifecycle (critical):
• Introduces a UOW helper (internal/storage/dolt/embedded_uow.go) to ensure db.Close() and connector.Close() happen
together after each unit of work.
• Updates internal/storage/dolt/store.go to:
• Enable driver open retries with a bounded exponential backoff (MaxElapsedTime = 30s).
• Avoid “context poisoning” from short-lived open contexts by forcing the initial open/ping with a safe context.
• Ensure cleanup on failures (no leaked connector locks).
• Fix embedded path handling by using an absolute path when building file:// DSNs (prevents doubled paths like
.../.beads/dolt/.beads/dolt).
• Remove legacy lock-workaround material:
• Deletes the “Lock Contention” section from docs/DOLT-BACKEND.md (daemon-mode comment left untouched per prior
constraints).
• Repo hygiene / tooling:
• Updates GitHub Actions Go setup to follow the repository’s Go version automatically via go-version-file: 'go.mod'
(CI/nightly/release).
• Suppresses gosec G304 in cmd/bd/migrate_dolt.go with a scoped justification (postMergePath is derived from .git/hooks).
Why
• The embedded driver’s lock is owned by the connector’s engine, and database/sql does not close the connector for you.
Explicit UOW connector closure prevents leaked locks and makes multi-process contention predictable.
• Using the driver’s retry logic centralizes the correct behavior (and keeps Beads from accumulating bespoke lock
workaround code).
Test plan
• golangci-lint run ./...
• go test ./...