Add a few extra connections to prevent exceeding the pool size

This commit is contained in:
Ury Zhilinsky
2025-02-13 19:12:23 -08:00
parent 80d346ea0d
commit 0a67d46b0d

View File

@@ -236,7 +236,8 @@ def _download_boto3(
def _get_s3_transfer_manager(
session: boto3.Session, workers: int, botocore_config: botocore.config.Config | None = None
) -> s3_transfer.TransferManager:
config = botocore.config.Config(max_pool_connections=workers)
# Add a few extra connections to prevent exceeding the pool size.
config = botocore.config.Config(max_pool_connections=workers + 2)
if botocore_config is not None:
config = config.merge(botocore_config)
s3client = session.client("s3", config=config)