Skip to content

Record W0 SQLite pool race and tested upstream correction - #145

Merged
bazer merged 3 commits into
masterfrom
codex/fix-sqlite-pool-ownership
Sep 17, 2026
Merged

bazer merged 3 commits into
masterfrom
codex/fix-sqlite-pool-ownership

Conversation

@bazer

@bazer bazer commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Problem

W0-F1 intermittently failed with SQLite error 1, cannot start a transaction within a transaction. Investigation reproduced the exact error using published Microsoft.Data.Sqlite 10.0.11 alone: two distinct, still-open connections receive the same pooled native handle.

The driver's activation method publishes its active flag before its weak owner. A concurrent checkout can misclassify that intermediate state as a leaked connection and lend it to another owner. Reversing the two writes fixes the reproduced interleaving without disabling pooling, adding locks, or retrying transactions.

Changes

  • Record the cause, evidence, limitations and remaining dependency integration work.
  • Preserve the standalone published-package reproducer and a tested upstream patch with regression coverage.
  • Record a separate, hash-verified diagnostic archive; keep the original W0 evidence unchanged.
  • Link the investigation from the 0.10 roadmap.

This PR changes no DataLinq runtime code or package references. The upstream patch is a reviewable artifact, not an installed dependency. Upstream submission is complete: issue dotnet/efcore#39008 and fix PR dotnet/efcore#39009. Both disclose that this fix was found, reproduced and posted with GPT-6 Astra on Extra High, with the repository owner's authorization. The contributor has personally posted CLA acceptance. Upstream review and a corrected package release remain pending. W0-F1 remains open.

The user has now explicitly approved a limited sequencing exception: internal W1 async contracts and controllable-provider tests may proceed on v0.10. SQLite integration acceptance, W0-F1 closeout, final provider feasibility/public API freeze and release approval remain blocked. No runtime workaround, dependency change or evidence relabeling is included.

This targets master because the defect affects current consumers. The eventual corrected-package adoption should land on master and merge forward to v0.10 under the accepted workflow. W0 capture is recorded separately in #144.

Validation

  • Published 10.0.11 reproducer: duplicate live ownership and exact transaction error on wave 312.
  • Controlled source interleaving: fails before the correction, passes after.
  • Uninstrumented source stress: original fails on wave 351; corrected completes 800,000 opens with no duplicate ownership or other errors.
  • New regression in the actual upstream test project: fails against original main, passes with the correction.
  • Corrected upstream SQLite test application: 714 passed, 7 existing skips, 0 failed, with the normal upstream category=failing exclusion. This is not the full EF Core matrix.
  • Corrected upstream project builds with 0 warnings/errors. Published/source diagnostic tests target .NET 10; upstream's actual test app targets .NET 11.
  • Checked documentation links, byte identity of the embedded reproducer and patch, reverse application of the patch to the corrected upstream checkout, archive integrity and all 141 archived evidence file hashes.
  • Markdown whitespace check passes; the preserved patch retains its required context-line whitespace. DocFX build is not applicable: docs/dev-plans/** is excluded from the website.

Raw evidence remains local; only the report, patch and standalone reproducer are committed. A passing stress run is not proof that all possible races are absent, and no passing run retroactively changes the original W0 failure.

Preserve the published-package reproducer, upstream patch and regression test for W0-F1. Record the negative control, 800,000 corrected stress opens, upstream SQLite suite results and immutable diagnostic artifact identities.

Keep DataLinq on its unchanged official dependency and leave W0-F1 open until upstream integration, corrected package adoption and affected baseline evidence are complete.
Link upstream issue 39008 and PR 39009, preserve the requested GPT-6 Astra on Extra High disclosure, and record the pending personal CLA response.

Keep the tested patch and sealed evidence unchanged, and leave W0-F1 open until a corrected official driver is adopted and verified.
Record the explicit user-approved exception for internal async contracts and controllable-provider tests. Keep native SQLite acceptance, baseline closeout and release approval gated on a corrected official dependency and recaptured evidence.

Record the user-posted CLA acceptance without claiming upstream approval or changing the sealed evidence.
@bazer
bazer merged commit c9cffe7 into master Sep 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant