Skip to content

Commit 42b6f6a

Browse files
authored
Change internal pool IMPORTANT highlight to WARNING (#352)
1 parent 62f23a7 commit 42b6f6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/using-the-python-driver/using-plugins/UsingTheReadWriteSplittingPlugin.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The Read/Write Splitting Plugin is not currently supported for non-Aurora cluste
3232

3333
### Internal connection pooling
3434

35-
> [!IMPORTANT]\
35+
> [!WARNING]\
3636
> If internal connection pools are enabled, database passwords may not be verified with every connection request. The initial connection request for each database instance in the cluster will verify the password, but subsequent requests may return a cached pool connection without re-verifying the password. This behavior is inherent to the nature of connection pools and not a bug with the driver. `ConnectionProviderManager.release_resources` can be called to close all pools and remove all cached pool connections. Take a look at the [Postgres](../../examples/PGInternalConnectionPoolPasswordWarning.py) or [MySQL](../../examples/MySQLInternalConnectionPoolPasswordWarning.py) sample code for more details.
3737
3838
When `read_only` is first set on an `AwsWrapperConnection` object, the Read/Write Splitting Plugin will internally open a physical connection to a reader. The reader connection will then be cached for the given `AwsWrapperConnection`. Future `read_only` settings for the same `AwsWrapperConnection` will not open a new physical connection. However, other `AwsWrapperConnection` objects will need to open their own reader connections when `read_only` is first set. If your application frequently sets `read_only` on many `AwsWrapperConnection` objects, you can enable internal connection pooling to improve performance. When enabled, the AWS Advanced Python Driver will maintain an internal connection pool for each instance in the cluster. This allows the Read/Write Splitting Plugin to reuse connections that were established by previous `AwsWrapperConnection` objects.
@@ -46,8 +46,8 @@ The AWS Advanced Python Driver currently uses [SqlAlchemy](https://docs.sqlalche
4646
- The first optional argument takes in a `Callable` that can be used to return custom parameter settings for the connection pool. See [here](https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool) for a list of available parameters. Note that you should not set the `creator` parameter - this parameter will be set automatically by the AWS Advanced Python Driver. This is done to follow desired behavior and ensure that the Read/Write Splitting Plugin can successfully establish connections to new instances.
4747
- The second optional argument takes in a `Callable` that can be used to define custom key generation for the internal connection pools. Key generation is used to define when new connection pools are created; a new pool will be created each time a connection is requested with a unique key. By default, a new pool will be created for each unique instance-user combination. If you would like to define a different key system, you should pass in a `Callable` defining this logic. The `Callable` should take in a `HostInfo` and `Dict` specifying the connection properties and return a string representing the desired connection pool key. A simple example is shown below.
4848

49-
> :warning:
50-
> If you do not include the username in the connection pool key, connection pools may be shared between different users. As a result, an initial connection established with a privileged user may be returned to a connection request with a lower-privilege user without re-verifying credentials. This behavior is inherent to the nature of connection pools and not a bug with the driver. `ConnectionProviderManager.release_resources` can be called to close all pools and remove all cached pool connections.
49+
> [!WARNING]\
50+
> If you do not include the username in the connection pool key, connection pools may be shared between different users. As a result, an initial connection established with a privileged user may be returned to a connection request with a lower-privilege user without re-verifying credentials. This behavior is inherent to the nature of connection pools and not a bug with the driver. `ConnectionProviderManager.release_resources` can be called to close all pools and remove all cached pool connections.
5151
5252
```python
5353
def get_pool_key(host_info: HostInfo, props: Dict[str, Any]):

0 commit comments

Comments
 (0)