-
Notifications
You must be signed in to change notification settings - Fork 493
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
[Technical Question] Possible DNS issue - File Upload limiting connetion lifetime #3263
Comments
Hi @jmasek, this does appear to be a bug in the SDK. We'll get a fix out soon that sets the default connection lease timeout to 5 minutes on the HTTP client used for file upload operations. |
#3266 should fix this issue |
Hi @timtay-microsoft, thanks for the quick fix! |
It may be a week or two before we put out a release. If you need this fix now, I recommend making the same change that the SDK made here in your code. This change uses a static class that all HttpClients will reference, so it is safe to make this change outside of the SDK. ServicePoint servicePoint = ServicePointManager.FindServicePoint("<your hub name>.azure-devices.net");
servicePoint.ConnectionLeaseTimeout = <your preferred timeout>; |
Hi @timtay-microsoft, Thanks |
Good catch. #3279 will make it so that the SDK handles this timeout on all the target frameworks correctly. |
And #3280 will do the same for our soon-to-be-released v2 packages |
Hi Tim, |
Good points. After some further thought, I don't think there is a way for this SDK to set the connection lease timeout for you by default if you are using a .NET core app. Our device SDK does not target .NET core, so we can't use preprocessor directives to create a While this is unfortunate, we will make it so that users can pass in an Given that we aim to only target netstandard 2.0 in our v2 client, users will need to do the same thing in that package as well. I'll leave #3293 open for your comments @jmasek and we'll review it internally as well. |
Hi, #3293 looks good 👍 I think it is a good approach to allow users to pass the |
Sounds good. We've decided to go just a bit further and allow you to pass in the |
We are working to put out a v1 release with this fix within the next day or two, FYI |
great, thanks. Keep me posted 😉 |
We have done a main release and a preview release that both contain this fix, so I'm closing this issue. For anyone reading this thread looking for a tl;dr, the SDK doesn't handle this scenario for you on older frameworks, but it does on newer frameworks. Older framework users must provide the HTTP client with a connection lease timeout set. |
…work (Azure#3279) Previous fix only worked for .NET framework, not .NET core Azure#3263
Hi,
we are using your SDK on approx 20 thousand devices all around the world. However, we are seeing that some devices (approx 1000 devices out of 20k) have problems with File Upload (they got stuck on the method
DeviceClient.GetFileUploadSasUriAsync
). After some digging, we suspect that the DNS change of IoT Hub occurred but the underlying HttpClient keeps using the old IP address.I discovered that in your SDK, there are two classes
HttpClientHelper
. The one in the namespaceMicrosoft.Azure.Devices
allows specifyingconnectionLeaseTimeoutMilliseconds
by passing proper options to the caller but the one that is used for file uploads - in the namespaceMicrosoft.Azure.Devices.Client.Transport
does not have such a parameter and is created with defaultPooledConnectionLifetime
set to infinite. Therefore, I have the following questions:Thank you,
Jan
The text was updated successfully, but these errors were encountered: