Repository navigation
asyncpg v0.32.0 - #1385
Merged
Merged
asyncpg v0.32.0#1385
Conversation
## Improvements * Support Python 3.15 (#1367, #1378) (by @elprans in 1b11846 and 58c0c59) * Support PostgreSQL 19 (#1379) (by @elprans in 8d2a5ae) * Make pool `min_size` a maintained connection floor and add `init_size` to control the number of connections opened at startup (#1323). Idle connections at or below `min_size` are retained, and closed connections are replaced in the background. `init_size` defaults to `min_size`. To preserve the previous behavior, where the pool could drain to zero, replace `min_size=N` with `init_size=N, min_size=0`. (by @shatilov-diman in 67a1cbc) * Use `hashlib.pbkdf2_hmac()` for faster SCRAM password derivation (#1359) (by @twelfthlabor in 00319a9) * Use the statement cache for `copy_records_to_table()` introspection (#1360) (by @matemax in dd05865) ## Fixes * Clean up connections rejected by `target_session_attrs` immediately so an unresponsive rejected host cannot delay the selected connection, and cleanup tasks cannot outlive the event loop. Rejected connections are aborted without waiting for a graceful disconnect; servers may log "unexpected EOF on client connection" if the Terminate message is not delivered before the transport closes. * Fix a connection pool deadlock when releasing a connection after a protocol abort (#1324) (by @pchaseh in 4a83cc2) * Honor `Connection.close(timeout=...)` while waiting for a pending cancellation (#1361) (by @gyanu2507 in c06bcb4) * Prevent stuck cancellation from blocking connection teardown or pool release by bounding cancellation with the command or release timeout (#1370) (by @elprans in 4cf0220) * Preserve the server error when the connection closes mid-operation (#1369) (by @RitiGrover in 6c8f1a7) * Fix COPY cleanup when a records generator raises, preserving the original exception and avoiding protocol desynchronization and stalled rollback (#1358) (by @CodingCossack in fdc6bc8) * Reparse unnamed statements before cursor binding when the statement cache is disabled (#1364) (by @elprans in 302ba49) * Allow cursors in transactions started outside `Connection.transaction()`, such as with an explicit `BEGIN` (#1350) (by @aryansk in 25aaaf5) * Remove the query logger when the `query_logger()` block raises (#1373) (by @kratos0718 in 6a7fbd3) * Fix a segfault in `Record.get()` with an invalid number of positional arguments (#1333) (by @apoorvdarshan in 40a3832) * Align SSL startup retries with libpq and improve SSL rejection diagnostics (#1366). Retry alternative transports only before authentication succeeds. Direct TLS now requires `sslmode=require`, `verify-ca`, or `verify-full`, or an explicit `SSLContext`. (by @elprans in 78752c9) * Preserve password errors during SSL fallback when the fallback fails with a less specific authorization error (#1331) (by @Mauricio0129 in 2d97947) * Handle cleartext password authentication when no password is supplied without raising an `AttributeError` (#1351) (by @aryansk in 6be5915) * Set the `postgresql` ALPN protocol on SSL contexts created by asyncpg so direct TLS connections work with PostgreSQL 17 and later (#1372). User-provided contexts must set this protocol for direct TLS connections. (by @DurandA in b21325d) * Link explicitly against `libm` on non-Windows platforms to fix undefined math symbol errors when loading the extensions (#1305) (by @veeceey in db8ecc2) * Fix builds on FreeBSD 15 by linking against `libstdthreads` (#1368) (by @elprans in 87bcaf9) ## Other * Replace `pkg_resources` with `packaging` in `setup.py` (#1362) (by @elprans in 6695db7) * Build Linux and macOS ARM64 wheels on native runners and add Windows ARM64 wheel builds (#1308) (by @ddelange in 1e8cc1c) * Add manual and PR-label-triggered dry runs to the release workflow (#1374) (by @elprans in 1bd643e) * Clarify how `execute()` uses prepared statements and how to confirm an `INSERT` in the documentation (#1336) (by @pctablet505 in cdf816c) * Fix typos in comments and docstrings (#1332) (by @maxtaran2010 in bc3e246)
Collaborator
|
Since Python 3.9 and 3.10 are both EOL, will they be removed from the supported versions for 0.32? |
This branch was successfully deployed
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.
Improvements
Support Python 3.15 (Run CI tests on Python 3.15 #1367, Bump uvloop #1378)
(by @elprans in 1b11846 and 58c0c59)
Support PostgreSQL 19 (Support PostgreSQL 19 #1379)
(by @elprans in 8d2a5ae)
Make pool
min_sizea maintained connection floor and addinit_sizetocontrol the number of connections opened at startup (True connection floor for the pool #1323).
Idle connections at or below
min_sizeare retained, and closed connectionsare replaced in the background.
init_sizedefaults tomin_size.To preserve the previous behavior, where the pool could drain to zero,
replace
min_size=Nwithinit_size=N, min_size=0.(by @shatilov-diman in 67a1cbc)
Use
hashlib.pbkdf2_hmac()for faster SCRAM password derivation (Use hashlib.pbkdf2_hmac for SCRAM salted password #1359)(by @twelfthlabor in 00319a9)
Use the statement cache for
copy_records_to_table()introspection (Use statement cache for copy_records_to_table introspection #1360)(by @matemax in dd05865)
Fixes
Clean up connections rejected by
target_session_attrsimmediately so anunresponsive rejected host cannot delay the selected connection, and cleanup
tasks cannot outlive the event loop. Rejected connections are aborted without
waiting for a graceful disconnect; servers may log "unexpected EOF on client
connection" if the Terminate message is not delivered before the transport
closes.
Fix a connection pool deadlock when releasing a connection after a protocol
abort (Fix connection pool deadlock #1324)
(by @pchaseh in 4a83cc2)
Honor
Connection.close(timeout=...)while waiting for a pendingcancellation (Bound close(timeout) around a pending cancel #1361)
(by @gyanu2507 in c06bcb4)
Prevent stuck cancellation from blocking connection teardown or pool release
by bounding cancellation with the command or release timeout (Prevent stuck cancellation from blocking connection teardown #1370)
(by @elprans in 4cf0220)
Preserve the server error when the connection closes mid-operation (Keep the server error when the connection closes mid-operation #1369)
(by @RitiGrover in 6c8f1a7)
Fix COPY cleanup when a records generator raises, preserving the original
exception and avoiding protocol desynchronization and stalled rollback (Fix COPY cleanup when a records generator raises #1358)
(by @CodingCossack in fdc6bc8)
Reparse unnamed statements before cursor binding when the statement cache
is disabled (Reparse unnamed statements before cursor binding #1364)
(by @elprans in 302ba49)
Allow cursors in transactions started outside
Connection.transaction(),such as with an explicit
BEGIN(Allow cursors in externally managed transactions #1350)(by @aryansk in 25aaaf5)
Remove the query logger when the
query_logger()block raises (Remove the query logger when the query_logger() block raises #1373)(by @kratos0718 in 6a7fbd3)
Fix a segfault in
Record.get()with an invalid number of positionalarguments (Fix segfault in Record.get() with invalid positional argument count #1333)
(by @apoorvdarshan in 40a3832)
Align SSL startup retries with libpq and improve SSL rejection diagnostics
(Align SSL startup retries with libpq and fix rejection diagnostics #1366). Retry alternative transports only before authentication succeeds.
Direct TLS now requires
sslmode=require,verify-ca, orverify-full,or an explicit
SSLContext.(by @elprans in 78752c9)
Preserve password errors during SSL fallback when the fallback fails with
a less specific authorization error (fix: do not retry on wrong password (28P01) with sslmode=allow/prefer #1331)
(by @Mauricio0129 in 2d97947)
Handle cleartext password authentication when no password is supplied
without raising an
AttributeError(Handle missing password authentication cleanly #1351)(by @aryansk in 6be5915)
Set the
postgresqlALPN protocol on SSL contexts created by asyncpg sodirect TLS connections work with PostgreSQL 17 and later (Set postgresql ALPN on SSL contexts created by asyncpg #1372).
User-provided contexts must set this protocol for direct TLS connections.
(by @DurandA in b21325d)
Link explicitly against
libmon non-Windows platforms to fix undefinedmath symbol errors when loading the extensions (Add explicit libm linkage to fix undefined symbol errors #1305)
(by @veeceey in db8ecc2)
Fix builds on FreeBSD 15 by linking against
libstdthreads(Fix builds on FreeBSD 15 #1368)(by @elprans in 87bcaf9)
Other
Replace
pkg_resourceswithpackaginginsetup.py(Drop use of pkg_resources from setup.py #1362)(by @elprans in 6695db7)
Build Linux and macOS ARM64 wheels on native runners and add Windows ARM64
wheel builds (Build linux/macos arm64/aarch64 wheels on native runners #1308)
(by @ddelange in 1e8cc1c)
Add manual and PR-label-triggered dry runs to the release workflow (Add dry-run paths to release workflow #1374)
(by @elprans in 1bd643e)
Clarify how
execute()uses prepared statements and how to confirm anINSERTin the documentation (docs: clarify that execute() uses prepared statements and how to confirm INSERT #1336)(by @pctablet505 in cdf816c)
Fix typos in comments and docstrings (Fix typos in comments and docstrings #1332)
(by @maxtaran2010 in bc3e246)