Skip to content

[V3] Add the ConnectTimeout property on the service client config for the … #3820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025

Conversation

normj
Copy link
Member

@normj normj commented May 16, 2025

Description

In the .NET 8 target we have access to the ConnectTimeout. This PR exposes the ability to set the ConnectTimeout on the service client.

In the V4 version of this AWSSDK.Extensions.NETCore.Setup was also updated but in this V3 PR it was not. That is because in V3 extends from the ClientConfig so it automatically inherits the properties. In V4 we removed the inheritance so I need to copy the ConnectTimeout to AWSSDK.Extensions.NETCore.Setup and add the logic to copy the setting the service client config.

Motivation and Context

This will help in scenario the SDK is trying to connect to a bad host and gets stuck trying to create the connection for a long period. If the user sets the connect timeout the SendAsync will timeout after the connect timeout has expired and since it is an IO exception the SDK will retry possibly to a different host.

Testing

Dry run successful: DRY_RUN-394333cd-113a-4bbe-a5f0-a13ba692b64c
Manually confirmed by setting a low connect timeout that the SDK does do a retry when the connect timeout happens.

get
{
if (!this._connectTimeout.HasValue)
return null;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I would like to default this to DefaultConfiguration.ConnectTimeout instead of null but changing the default timeout would be a breaking change. Maybe when we do a 4.1 we can reconsider the default.

@normj normj merged commit 50d2732 into aws-sdk-net-v3.7-development May 16, 2025
3 checks passed
@normj normj deleted the normj/add-connection-timeout-v3 branch May 16, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants