Repository navigation
Conversation
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.
Cancelling
Pool::begin_withafter PostgreSQL executesBEGINmust roll back before the backend is reused. The driver fix is already onmainvia #4394; this PR replaces its sleep-based regression test with the deterministic advisory-lock reproduction from #4423.The test waits until
pg_stat_activityconfirms the backend is blocked afterBEGIN, drops the pending future, and releases the lock. It then verifies that the same backend returns idle and that a subsequent pooled write survives a later transaction rollback. The synchronization works across supported runtimes without spawning a task.Does your PR solve an issue?
Fixes #4423 by verifying the existing driver fix with the reported reproduction and strengthening regression coverage.
Is this a breaking change?
No. This only changes the PostgreSQL integration test.
Validation
Tested with PostgreSQL 17.11 and Rust 1.94.1:
cargo test --no-default-features --features postgres,macros,runtime-tokio --test postgres --test postgres-error -- --skip test_pg_copy_chunked: 63 passed, 2 already ignored; the large COPY test is run separately by CI.idle in transactioninstead ofidle; restoring the existing fix makes it pass.cargo fmt --all -- --checkpasses.cargo clippy --no-default-features --features postgres,macros,runtime-tokio -- -D warningspasses.Strict Clippy checks including
--test postgresencounter existing warnings insqlx-test/src/lib.rsand unchanged portions oftests/postgres/postgres.rs.