-
Notifications
You must be signed in to change notification settings - Fork 492
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
DeviceClient/ModuleClient goes into a bad state and throws ObjectDisposedExceptions on subsequent operations #953
Comments
I experienced this issue yesterday morning (around 08:00 UTC). There seemed to be a service outage in North Europe which prevented the edgeHub module on my devices communicating with the IoT Hub. As a result, the following exception was thrown repeatedly...
When service was restored, the device did not recover and I had to manually restart the edgeHub container on the device. |
I had the same yesterday, around 2 hours earlier, with an IoT Hub in West Europe. Thus, I would assume it was a rolling service upgrade / update, not necessarily an outage, that caused clients to reconnect. |
We experience the same issue both within Edge and Regular IoT Devices/Modules.
|
We've been seeing this issue in production in Europe but not elsewhere:
It requires a manual restart of the entire IoT Edge service via |
@varunpuranik, @Hammatt, @AMCN41R, @sebader, @vladislav-mitev thanks for the patient and this issue is fixed in PR(1001)via AMQP redesign. We're under long haul testing in a stress platform. It will be released once the test are completed. |
@davilu, thanks a lot for your contributions. This issue has been frustrating. However, you only refer to the AMQP transport being fixed. What about MQTT? We are mostly using MQTT and still suffer from this very problem. I suppose that both implementations are similar. Also, do you have any rough idea as to when we could expect this to be released? |
We are very close to releasing the new SDK with the fixes. Tentative date is Sept 15th. However that would only contain AMQP fixes. |
We're fairly sure we're getting a similar problem when UK or US IoT hubs are bouncing too. We have some code to try tear down the connection if has not recovered in a certain amount of time. Eagerly awaiting this fix all the same though! |
This issue is now fixed and should be a part of latest release v1.21.1 |
@AMCN41R, @sebader, @prmathur-microsoft, @vladislav-mitev, @Hammatt, @davilu, @petermillsacumentive, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey |
Thanks for the release, great job. One note, however. The description of the issue does not contain any protocol specifics and as far as this issue is happening for MQTT transport as well, shouldn't this issue be used for that fix also? (Or should we report another one?) |
Can you please open another one to track mqtt? |
Description of the issue:
It seems like the DeviceClient/ModuleClient sometimes goes into a bad state and disposes the underlying transport. This causes subsequent operations to throw an OperationDisposedException, even through CloseAsync or Dispose is never called on the object.
On further investigation, it seems like the Reconnect logic in RetryingDelegatingHandler.HandleDisconnect throws, which causes the transport to get disposed here (line 591) -
azure-iot-sdk-csharp/iothub/device/src/Transport/RetryDelegatingHandler.cs
Lines 582 to 592 in e1dd08e
In our application, we get the 2 callbacks triggered from this method -
azure-iot-sdk-csharp/iothub/device/src/Transport/RetryDelegatingHandler.cs
Line 540 in e1dd08e
azure-iot-sdk-csharp/iothub/device/src/Transport/RetryDelegatingHandler.cs
Line 616 in e1dd08e
Expected behavior would be -
The text was updated successfully, but these errors were encountered: