Misalignment between custom botocore.config retry parameters and the time it takes to raise ConnectTimeoutError #3298
Labels
bug
This issue is a confirmed bug.
cloudwatch
p3
This is a minor priority issue
response-requested
Waiting on additional info and feedback.
Describe the bug
When connection cannot be stablished using a CloudWatch boto3 client, the time it takes to raise the ConnectTimeoutError does not match the time it should take given the custom parameters defined using the botocore.config Config class.
The time to raise the connection error consistently takes three times the max. number of retrials or max timeout time.
Regression Issue
Expected Behavior
Given the following custom configuration to be applied in a CloudWatch boto3 client:
After testing the retrials behaviour when the connection cannot be stablished, with different parameter configurations I obtain the following execution times (time difference between cloudwatch.PutMetricData is logged and the ConnectTimeoutError is raised):
Current Behavior
After testing the retrials behaviour when the connection cannot be stablished, with different parameter configurations I obtain the following execution times (time difference between cloudwatch.PutMetricData is logged and the ConnectTimeoutError is raised):
Reproduction Steps
Create the following custom configuration to be applied in a CloudWatch boto3 client:
Execute the code from an AWS Service that does not have permissions to access/write Cloudwatch metrics (in my case it was a Sagemaker endpoint).
Package versions
botocore = 1.35.58
boto3 = 1.35.58
urllib3 = 2.2.3
Possible Solution
It looks like the source of the problem (see additional info/context to check full error logs) is related to urllib connection session parameters not being overwritten by custom retry parameters. Therefore urllib connection is executed as many times as its default parameter: 3.
Additional Information/Context
The full error obtained when connection cannot be established is:
SDK version used
1.35.58
Environment details (OS name and version, etc.)
Linux
The text was updated successfully, but these errors were encountered: