Repository navigation
fix(db): recover stuck sqlx transaction-depth counter in begin_immediate - #361
Merged
Merged
Conversation
The deployed binary on 192.168.1.202 (69245e2 bundle, Oct 29) predates the job-level environment field; its parser rejects the key (fail-closed per 0857218), so every push event for 7f4e8fd failed with 'unknown job key environment'. The top-level environment: {} remains — that one the deployed parser requires and accepts.
Clippy (rust 1.99 in dsc-ci-rust:12) flags the manual str::repeat pattern as manual_str_repeat/manual_repeat_n under -D warnings. Co-Authored-By: Claude <noreply@anthropic.com>
A busy branch occupied its repository's FIFO trigger lane for the whole of each ~10-minute pipeline, leaving other refs of the same repo starved: five main-branch trigger requests sat pending for hours while codex-branch pushes kept re-arming the lane, and the republish redrive could not help because it re-queued into the same lane. Lane keys now include the ref name, so ordering holds within a ref while cross-ref starvation is impossible.
sqlx's per-connection depth counter can desync in two directions. The 2026-10-08 fix (bare ROLLBACK probe) handles the SQLite-side orphan, but the counter-side direction - depth stuck above zero with no live Transaction owner - rejected every begin_with carrying a custom statement with "attempted to call begin_with at non-zero transaction depth" before any statement reached SQLite. Raw ROLLBACK cannot fix that direction: the counter only moves through sqlx's managed commands. Live 2026-11-02: every pipeline-activation trigger failed five times with the depth error while healthy runs kept serving from the same pool, so an OpenCodifier commit sat un-run for hours. begin_immediate now detects the depth-error signature and unwinds the counter with a managed begin/rollback pair (SAVEPOINT at depth > 0, decrement on rollback) before retrying. Regression test injects the stuck state on a single-connection pool, mirroring the deterministic MRU re-handout that made every retry fail.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
🤖 AI Code Review ResultsAI review skipped: provider 'anthropic' is not configured; deterministic gates remain authoritative. ✅ No critical issues found. AI Code Review powered by GitForge |
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
begin_withbefore reaching SQLite; raw ROLLBACK recovery (direction 1) cannot fix it.begin_immediatenow unwinds the counter with managed SAVEPOINT begin/rollback passes, holding the connection out of the pool during the unwind.non-zero transaction depthwhile healthy runs kept serving the same pool).Test plan
test_begin_immediate_unwinds_stuck_depth_counterpassescargo clippy -p gitforge-db --all-targets -- -D warningscleancargo fmt --all -- --checkclean