Skip to content
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

Fix file upload HTTP client not handling DNS changes #3266

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

timtay-microsoft
Copy link
Member

@timtay-microsoft timtay-microsoft commented Apr 13, 2023

By setting the connection lease timeout to 5 minutes (defaults to infinite), HTTP operations will perform DNS lookups once every 5 minutes. This allows a client to continue performing file upload operations even if the service changes DNS due to failover.

We already set this value in the HTTP clients used elsewhere in this library.

#3263

Note that this is already fixed in v2

By setting the connection lease timeout to 5 minutes (defaults to infinite), HTTP operations will perform DNS lookups once every 5 minutes. This allows a client to continue performing file upload operations even if the service changes DNS due to failover
@timtay-microsoft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timtay-microsoft timtay-microsoft merged commit be0a5a5 into main Apr 13, 2023
@timtay-microsoft timtay-microsoft deleted the timtay/connectionLeaseTimeout branch April 13, 2023 23:32
@@ -59,6 +75,9 @@ internal sealed class HttpClientHelper : IHttpClientHelper
_authenticationHeaderProvider = authenticationHeaderProvider;
_defaultErrorMapping = new ReadOnlyDictionary<HttpStatusCode, Func<HttpResponseMessage, Task<Exception>>>(defaultErrorMapping);

ServicePoint servicePoint = ServicePointManager.FindServicePoint(_baseAddress);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this also a work around a user could make in their own app if they are using an SDK that doesn't do this?

timstewartm pushed a commit to timstewartm/azure-iot-sdk-csharp that referenced this pull request May 30, 2024
By setting the connection lease timeout to 5 minutes (defaults to infinite), HTTP operations will perform DNS lookups once every 5 minutes. This allows a client to continue performing file upload operations even if the service changes DNS due to failover
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