Skip to content

Fix DbWriter transaction scope races - #2686

Merged
Widthdom merged 4 commits into
mainfrom
fix-issue2676-1783-1741-1733
May 25, 2026
Merged

Fix DbWriter transaction scope races#2686
Widthdom merged 4 commits into
mainfrom
fix-issue2676-1783-1741-1733

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Serialize DbWriter transaction scopes on a writer while preserving same-thread nested savepoints.
  • Keep transaction depth consistent when SQLite transaction/savepoint start fails.
  • Make savepoint connection lifecycle failures explicit and log rollback failures during best-effort disposal.
  • Route ready-bit and fold-ready stamping through the writer transaction gate to avoid nested BEGIN IMMEDIATE on shared writers.

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~ConcurrencyTests|FullyQualifiedName~DatabaseTests" -p:UseSharedCompilation=false
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet test CodeIndex.sln -p:UseSharedCompilation=false
  • codex exec review "Review only the diff from origin/main to HEAD. Follow .codex/workflows/adversarial-review.md exactly. Report only blocking/actionable issues."

Documentation and changelog

  • Added issue-based bilingual changelog fragments:
    • changelog.d/unreleased/1733.fixed.md
    • changelog.d/unreleased/1741.fixed.md
    • changelog.d/unreleased/1783.fixed.md
    • changelog.d/unreleased/2676.fixed.md
  • Updated DbWriter XML documentation for the transaction-scope serialization invariant.

Follow-up candidates

Fixes #2676
Fixes #1783
Fixes #1741
Fixes #1733

Widthdom added 2 commits May 25, 2026 12:08
…41-1733

# Conflicts:
#	changelog.d/unreleased/2676.fixed.md
#	src/CodeIndex/Database/DbWriter.cs
@Widthdom
Widthdom marked this pull request as ready for review May 25, 2026 03:28
@Widthdom
Widthdom merged commit 6b7e038 into main May 25, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue2676-1783-1741-1733 branch May 25, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment