Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,40 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/#semantic-versioning-200).

## [Unreleased]
## [3.2.0] - 2026-12-03

> [!WARNING]
> Asynchronous applications that connect to **multiple database clusters** must now set a unique `cluster_id` for each cluster. Without it, connections to different clusters share one topology. See the [Cluster ID documentation](./docs/using-the-python-wrapper/ClusterId.md).

### :magic_wand: Added
* The `connection_lifetime` plugin, bounding how long a physical connection is used. Once `connection_lifetime_ms` has elapsed, the next network-bound call either closes the connection or reconnects through the host the application originally supplied, depending on `connection_lifetime_action`. Expiration is deferred while a transaction is open, and reports through `ConnectionLifetimeSuccessError`, `ConnectionLifetimeExpiredError` or `ConnectionLifetimeFailedError` so a connection pool can tell a usable connection from a dead one. With an internal connection pool, the plugin evicts an expired connection so the pool closes it instead of handing it out again. Available in both the synchronous and asynchronous wrapper. See [Connection Lifetime Plugin](./docs/using-the-python-wrapper/using-plugins/UsingTheConnectionLifetimePlugin.md).
* Synchronous plugins can replace the arguments that `Cursor.execute` and `Cursor.executemany` pass to the plugins after them and to the target driver, without modifying the caller's objects, by assigning new `args` and `kwargs` to the plugin service's `current_call_context`. See [The Call Context](./docs/development-guide/PluginService.md#the-call-context). ([PR #1330](https://github.com/aws/aws-advanced-python-wrapper/pull/1330))
* The `failover` and `failover_v2` plugins currently rewraps all errors to an AwsWrapperError even when the errors do not trigger failover. Set the `preserve_driver_exception_type` configuration parameter to `True` to re-raise the target driver errors as-is for the failover plugins. Failover errors are unaffected and are still raised as `FailoverSuccessError`, `FailoverFailedError` or `TransactionResolutionUnknownError`. This is useful for ORMs to properly classify the errors. ([Issue #1275](https://github.com/aws/aws-advanced-python-wrapper/issues/1275))
* KMS Encryption Plugin (`kms_encryption`), which encrypts the values an application binds for columns configured in the database's encryption metadata before the driver sends them, and decrypts them on read, with each column's data key protected by an AWS KMS master key. Install it with `pip install "aws-advanced-python-wrapper[encryption]"`, and add a database-side trigger to every encrypted column with the trigger SQL that ships in `aws_advanced_python_wrapper/encryption/sql`. The plugin works with the synchronous wrapper only. See [KMS Encryption Plugin](./docs/using-the-python-wrapper/using-plugins/UsingTheKmsEncryptionPlugin.md). ([PR #1331](https://github.com/aws/aws-advanced-python-wrapper/pull/1331))
* The `connection_lifetime` plugin, which closes or reconnects a physical connection once it reaches `connection_lifetime_ms`, in both the synchronous and asynchronous wrapper. See [Connection Lifetime Plugin](./docs/using-the-python-wrapper/using-plugins/UsingTheConnectionLifetimePlugin.md). ([PR #1365](https://github.com/aws/aws-advanced-python-wrapper/pull/1365))
* The `preserve_driver_exception_type` parameter, which makes the `failover` and `failover_v2` plugins re-raise driver errors that do not trigger failover as they are, so ORMs can classify them. ([Issue #1275](https://github.com/aws/aws-advanced-python-wrapper/issues/1275), [PR #1282](https://github.com/aws/aws-advanced-python-wrapper/pull/1282))
* The KMS Encryption Plugin (`kms_encryption`), which encrypts values bound for configured columns with AWS KMS-protected data keys and decrypts them on read, in the synchronous wrapper. Install it with `pip install "aws-advanced-python-wrapper[encryption]"`. See [KMS Encryption Plugin](./docs/using-the-python-wrapper/using-plugins/UsingTheKmsEncryptionPlugin.md). ([PR #1331](https://github.com/aws/aws-advanced-python-wrapper/pull/1331))
* Synchronous plugins can replace the arguments that `Cursor.execute` and `Cursor.executemany` pass on, through the plugin service's `current_call_context`. See [The Call Context](./docs/development-guide/PluginService.md#the-call-context). ([PR #1330](https://github.com/aws/aws-advanced-python-wrapper/pull/1330))
* Support for Aurora cluster group writer and reader endpoints. ([PR #1366](https://github.com/aws/aws-advanced-python-wrapper/pull/1366))
* A configuration reference for AI coding assistants, [PYTHON-WRAPPER-CONFIGURATION-ASSISTANT.md](./docs/PYTHON-WRAPPER-CONFIGURATION-ASSISTANT.md). ([PR #1293](https://github.com/aws/aws-advanced-python-wrapper/pull/1293))

### :bug: Fixed
* With psycopg's synchronous cursor, a fetch chained onto `cursor.execute()` (`cursor.execute(query).fetchone()`) skipped every plugin, the failover and host monitoring plugins included, because `execute()` returned the driver's cursor. It now returns the wrapper's cursor, so `isinstance(cursor.execute(query), psycopg.Cursor)` is now `False`. ([PR #1330](https://github.com/aws/aws-advanced-python-wrapper/pull/1330))
* `next(cursor)` on a synchronous cursor raised `TypeError`. It now returns the next row through the plugins subscribed to `Cursor.__next__`. ([PR #1330](https://github.com/aws/aws-advanced-python-wrapper/pull/1330))
* Loops over a synchronous cursor (`for row in cursor`) skipped every plugin. A loop now calls the plugins subscribed to `Cursor.__iter__`, and those subscribed to every method, such as `execute_time`, once per loop, not once per row. A loop over a cursor whose connection is no longer the current one now raises `AwsWrapperError` where `fetchone` does. ([PR #1330](https://github.com/aws/aws-advanced-python-wrapper/pull/1330))
* Queries waiting for a busy wrapper thread pool raised `QueryTimeoutError` even when they ran within `socket_timeout`, because the timeout counted the wait. The timeout now starts when the query starts running. ([Issue #1278](https://github.com/aws/aws-advanced-python-wrapper/issues/1278), [PR #1294](https://github.com/aws/aws-advanced-python-wrapper/pull/1294))
* With psycopg, a fetch chained onto `cursor.execute()` skipped every plugin, including failover and host monitoring. `execute()` now returns the wrapper's cursor, so `isinstance(cursor.execute(query), psycopg.Cursor)` is now `False`. ([PR #1330](https://github.com/aws/aws-advanced-python-wrapper/pull/1330))
* `for row in cursor` on a synchronous cursor skipped every plugin, and `next(cursor)` raised `TypeError`. Both now go through the plugins. ([PR #1330](https://github.com/aws/aws-advanced-python-wrapper/pull/1330))
* The synchronous wrapper kept selecting a host that refused connections, and now marks such a host unavailable. ([PR #1297](https://github.com/aws/aws-advanced-python-wrapper/pull/1297))
* DEBUG logs, error messages and `repr()` output included auth tokens, Secrets Manager secret values, passwords and statement text, which are now omitted or masked. ([PR #1340](https://github.com/aws/aws-advanced-python-wrapper/pull/1340))
* Blue/Green deployments: a call suspended during a switchover hung at full CPU after the switchover moved on, and new connections were not routed to the green hosts. ([PR #1360](https://github.com/aws/aws-advanced-python-wrapper/pull/1360), [PR #1401](https://github.com/aws/aws-advanced-python-wrapper/pull/1401))
* The Limitless Router Monitor failed to start when a `limitless-router-monitor-` prefixed property was set. ([PR #1393](https://github.com/aws/aws-advanced-python-wrapper/pull/1393))
* After a failover, a connection to the writer cluster endpoint was sent to the old writer, which is now a reader. ([PR #1371](https://github.com/aws/aws-advanced-python-wrapper/pull/1371))
* With mysql-connector, closing a cursor opened before a failover raised `ReferenceError` instead of letting `FailoverSuccessError` through. ([PR #1371](https://github.com/aws/aws-advanced-python-wrapper/pull/1371))
* The Aurora Initial Connection Strategy plugin retried a failing host with no delay and left a connection open on each attempt. It also kept choosing a reader that refused connections, and failed without connecting when `open_connection_retry_timeout_ms` was `0`. ([PR #1291](https://github.com/aws/aws-advanced-python-wrapper/pull/1291))
* Asynchronous wrapper fixes:
* `async for` over a cursor stopped at the first `None` row and lost the rows after it. ([PR #1392](https://github.com/aws/aws-advanced-python-wrapper/pull/1392))
* The Aurora connection tracker closed its own connection on the first statement, and host monitoring v2 recreated its monitors on every statement. ([Issue #1276](https://github.com/aws/aws-advanced-python-wrapper/issues/1276), [Issue #1287](https://github.com/aws/aws-advanced-python-wrapper/issues/1287), [PR #1348](https://github.com/aws/aws-advanced-python-wrapper/pull/1348))
* Plugins such as `initial_connection`, `host_monitoring` and `stale_dns` received a host list without the cluster topology. ([PR #1292](https://github.com/aws/aws-advanced-python-wrapper/pull/1292))
* Each connection ran its own topology monitor and monitoring connection, and connections to the same cluster now share one. ([PR #1295](https://github.com/aws/aws-advanced-python-wrapper/pull/1295))
* An error while creating a cursor reached the application instead of starting failover. ([PR #1371](https://github.com/aws/aws-advanced-python-wrapper/pull/1371))

### :cloud: Changed
* The asynchronous wrapper now identifies a cluster by the `cluster_id` parameter (default `"1"`), as the synchronous wrapper does. ([PR #1295](https://github.com/aws/aws-advanced-python-wrapper/pull/1295))
* The Aurora Initial Connection Strategy plugin connects once and raises the driver's error when it has nothing to substitute or verify. It also rejects invalid values for `inactive_cluster_writer_endpoint_substitution_role`, `verify_inactive_cluster_writer_endpoint_connection_type` and `endpoint_substitution_role` on RDS Proxy and Limitless endpoints. ([PR #1291](https://github.com/aws/aws-advanced-python-wrapper/pull/1291))

## [3.1.0] - 2026-08-24
### :magic_wand: Added
Expand All @@ -24,7 +46,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
* Async (asyncio) counterpart of the wrapper (`aws_advanced_python_wrapper.aio`), targeting sync parity for the shipped plugins: failover v2, read/write splitting, EFM v2, IAM auth, AWS Secrets Manager, federated + Okta auth, Aurora connection tracker, cluster topology monitor, custom endpoint, stale DNS, Aurora initial connection strategy, simple read/write splitting, developer plugin, blue/green deployment, limitless, fastest-response strategy. Backed by psycopg async and aiomysql, with async SQLAlchemy support via `create_async_engine` (`postgresql+aws_wrapper_psycopg://` serves both sync and async; MySQL async uses `mysql+aws_wrapper_aiomysql://`). Includes `AsyncConnectionProvider`/`AsyncPooledConnectionProvider`, `AsyncSessionStateService`, an async IdP factory registry, and `release_resources_async()` for background-task teardown. ([PR #1257](https://github.com/aws/aws-advanced-python-wrapper/pull/1257))

### :bug: Fixed
* `socket_timeout` no longer treats time queued in the shared `DriverDialectExecutor` as query time. The timeout clock starts when a worker begins the call. If the queue-wait bound expires while the call is still queued, the future is cancelled so it cannot run later on the same connection; if the worker starts in that window, the existing abort/drain path runs. Queue wait is bounded by `max(timeout * 2, timeout + 5)` seconds so a saturated pool cannot stall a caller for a minute. ([Issue #1278](https://github.com/aws/aws-advanced-python-wrapper/issues/1278))
* Cross-thread use-after-free (SIGSEGV) when an offloaded query times out (e.g. during failover) and the connection is later closed or reused while the query is still running: on timeout the driver dialects now shut down the connection socket and wait for the worker to unwind before propagating, and leak rather than close a connection whose worker cannot be drained. ([PR #1252](https://github.com/aws/aws-advanced-python-wrapper/pull/1252))
* Schema-qualified every function, operator, cast and catalog reference in the PostgreSQL queries the driver issues internally, so a session `search_path` cannot redirect them. This covers the queries issued by the asynchronous Aurora host list provider as well. ([PR #1262](https://github.com/aws/aws-advanced-python-wrapper/pull/1262), [PR #1270](https://github.com/aws/aws-advanced-python-wrapper/pull/1270))
* Connection properties whose name indicates a credential are now masked when connection properties are logged. Previously only `password` was masked, so properties such as `idp_password` and the `monitoring-` and `blue-green-monitoring-` prefixed passwords were logged in clear text. The Secrets Manager properties remain readable, since they identify a secret rather than hold one. ([PR #1270](https://github.com/aws/aws-advanced-python-wrapper/pull/1270))
Expand Down Expand Up @@ -172,6 +193,7 @@ The Amazon Web Services (AWS) Advanced Python Wrapper allows an application to t
* Support for PostgreSQL
* Support for MySQL

[3.2.0]: https://github.com/aws/aws-advanced-python-wrapper/compare/3.1.0...3.2.0
[3.1.0]: https://github.com/aws/aws-advanced-python-wrapper/compare/3.0.0...3.1.0
[3.0.0]: https://github.com/aws/aws-advanced-python-wrapper/compare/2.1.0...3.0.0
[2.1.0]: https://github.com/aws/aws-advanced-python-wrapper/compare/2.0.0...2.1.0
Expand Down
3 changes: 2 additions & 1 deletion Maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
| February 11, 2026 | [Release 2.1.0](https://github.com/aws/aws-advanced-python-wrapper/releases/tag/2.1.0) |
| June 2, 2026 | [Release 3.0.0](https://github.com/aws/aws-advanced-python-wrapper/releases/tag/3.0.0) |
| August 24, 2026 | [Release 3.1.0](https://github.com/aws/aws-advanced-python-wrapper/releases/tag/3.1.0) |
| December 3, 2026 | [Release 3.2.0](https://github.com/aws/aws-advanced-python-wrapper/releases/tag/3.2.0) |

`aws-advanced-python-wrapper` [follows semver](https://semver.org/#semantic-versioning-200) which means we will only
release breaking changes in major versions. Generally speaking patches will be released to fix existing problems without
Expand Down Expand Up @@ -66,4 +67,4 @@ from the updated source after the PRs are merged.
|---------------|----------------------|-------------|------------------|--------------------------|------------------------|
| 1 | 1.4.0 | Maintenance | May 16, 2024 | January 14, 2026 | January 14, 2027 |
| 2 | 2.1.0 | Maintenance | January 14, 2026 | June 2, 2026 | June 2, 2027 |
| 3 | 3.1.0 | Current | June 2, 2026 | N/A | N/A |
| 3 | 3.2.0 | Current | June 2, 2026 | N/A | N/A |
2 changes: 1 addition & 1 deletion aws_advanced_python_wrapper/driver_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

class DriverInfo:
DRIVER_NAME = "aws_advanced_python_wrapper"
DRIVER_VERSION = "3.1.0"
DRIVER_VERSION = "3.2.0"
4 changes: 2 additions & 2 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ For more detailed information about how to use and configure the AWS Advanced Py

If you use an AI coding assistant (Kiro, Cursor, Claude Code, GitHub Copilot, ChatGPT, Amazon Bedrock, etc.), you can use the wrapper's configuration assistant skill to help build, review, or troubleshoot your wrapper configuration.

The skill is a single self-contained markdown file: [`PYTHON-WRAPPER-CONFIGURATION-ASSISTANT.md`](./PYTHON-WRAPPER-CONFIGURATION-ASSISTANT.md). It covers every plugin, parameter, default value, dialect, failover mode, and compatibility constraint of release 3.1.0, together with recipes for psycopg, MySQL Connector/Python, SQLAlchemy (sync and async), and Django, so the AI can answer configuration questions without access to the wrapper source.
The skill is a single self-contained markdown file: [`PYTHON-WRAPPER-CONFIGURATION-ASSISTANT.md`](./PYTHON-WRAPPER-CONFIGURATION-ASSISTANT.md). It covers every plugin, parameter, default value, dialect, failover mode, and compatibility constraint of release 3.2.0, together with recipes for psycopg, MySQL Connector/Python, SQLAlchemy (sync and async), and Django, so the AI can answer configuration questions without access to the wrapper source.

The file follows the [Agent Skills](https://agentskills.io) format. It is large: about 100,000 tokens on Claude Opus 5.5 (other models count tokens differently), and the AI receives it again with every message. Tools that cache the system prompt handle it far more cheaply than tools that resend it in full each time.

Expand Down Expand Up @@ -222,4 +222,4 @@ connections from a separate thread is not supported for the detected driver dial
'MySQLDriverDialect'". What's wrong?
```

The skill targets release 3.1.0 and avoids guessing: if it doesn't know something, it says so and points you at the official docs.
The skill targets release 3.2.0 and avoids guessing: if it doesn't know something, it says so and points you at the official docs.
Loading
Loading