Skip to content

Fix SQL engine panic when database is locked#10383

Merged
coffeegoddd merged 2 commits intomainfrom
db/bug
Jan 29, 2026
Merged

Fix SQL engine panic when database is locked#10383
coffeegoddd merged 2 commits intomainfrom
db/bug

Conversation

@coffeegoddd
Copy link
Copy Markdown
Contributor

• Prevent NewSqlEngine from panicking when a repo fails to open due to lock contention.
• Load-check the underlying DoltDB in engine DB collection and return the recorded load error (e.g.
nbs.ErrDatabaseLocked) instead of nil-dereferencing.
• Enables embedded/driver callers to detect “database locked” and safely retry engine initialization.

@coffeegoddd coffeegoddd requested a review from reltuk January 29, 2026 01:16
@coffeegoddd
Copy link
Copy Markdown
Contributor Author

@coffeegoddd DOLT

comparing_percentages
100.000000 to 100.000000
version result total
f8583cb ok 5937471
version total_tests
f8583cb 5937471
correctness_percentage
100.0

Copy link
Copy Markdown
Contributor

@reltuk reltuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. All seems fine here. Would be better to make it {Bulk,}DbEaFactory(ctx context.Context) (editor.DbEaFactory, error) ?

@coffeegoddd
Copy link
Copy Markdown
Contributor Author

@coffeegoddd DOLT

comparing_percentages
100.000000 to 100.000000
version result total
37408a9 ok 5937471
version total_tests
37408a9 5937471
correctness_percentage
100.0

@coffeegoddd coffeegoddd merged commit 460dc58 into main Jan 29, 2026
24 of 25 checks passed
@coffeegoddd coffeegoddd deleted the db/bug branch January 29, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants