diff --git a/roles/upload-logs-base/library/zuul_s3_upload.py b/roles/upload-logs-base/library/zuul_s3_upload.py index 42990e681..8e7217ea9 100755 --- a/roles/upload-logs-base/library/zuul_s3_upload.py +++ b/roles/upload-logs-base/library/zuul_s3_upload.py @@ -38,6 +38,7 @@ import sys import threading import boto3 +import botocore from ansible.module_utils.basic import AnsibleModule try: @@ -113,7 +114,13 @@ class Uploader(): self.url = os.path.join(return_endpoint, self.prefix) + # The default for max_pool_connections is 10, which is easily + # exhausted if the upload threads overwhelm them. + client_config = botocore.config.Config( + max_pool_connections=MAX_UPLOAD_THREADS * 4) + self.s3 = boto3.resource('s3', + config=client_config, endpoint_url=self.endpoint, **credential_args) self.bucket = self.s3.Bucket(bucket)