Repository navigation
chore: upgrade db-retry to 0.8.1 and SQLAlchemy to 2.0.55 - #71
Merged
Merged
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.
Raises the db-retry floor from 0.8.0 to 0.8.1 and upgrades SQLAlchemy from 2.0.54 to 2.0.55 in the lock. The
sqlalchemy[asyncio]<2.1pin stays.In db-retry 0.8.1,
Transaction.__aenter__rolls back the session's transaction on entry when that transaction can no longer continue: SQLAlchemy marked it inactive after a failed flush, or a connection it already holds was invalidated (modern-python/db-retry#75). With 0.8.0, a connection lost on a query or flush after the block made the retried attempt fail withPendingRollbackError. With 0.8.1 the retry starts on a fresh connection and recovers. A live transaction is still joined, so uncommitted work is kept.The rule that every query goes inside the
Transactionblock still applies. A query that runs before the block fails the retried attempt before__aenter__gets a chance to roll back.Release notes: https://github.com/modern-python/db-retry/releases/tag/0.8.1
SQLAlchemy 2.0.55 (released 2026-10-16) fixes ticket 13673. If a task was cancelled a second time while the pool was closing an asyncio connection invalidated by the first cancellation, the closed connection stayed in the pool, and the next checkout got it and failed on first use. With
pool_pre_pingoff, onlypostgres_retrywould have caught that. The release also fixes related cancellation handling in the pool (tickets 12710, 13622 and 13678).Checked locally:
just lint,just testandjust test-migrationsin Docker, with SQLAlchemy 2.0.55 and db-retry 0.8.1 installed in the container.