-
Notifications
You must be signed in to change notification settings - Fork 237
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(iot-dev): Fix 3 multiplexing scenario bugs #1753
Conversation
- Fix bug where a closing multiplexed device would report its state as ```Disconnected``` followed by ```Disconnected_retrying``` and then finally ```Disconnected``` - Fix bug where a multiplexed device that has its device session closed didn't cancel all of its outgoing messages
@@ -1388,6 +1390,7 @@ private void singleDeviceReconnectAttemptAsync(String deviceSessionToReconnect) | |||
{ | |||
this.updateStatus(IotHubConnectionStatus.DISCONNECTED, IotHubConnectionStatusChangeReason.RETRY_EXPIRED, transportException, deviceSessionToReconnect); | |||
log.debug("Reconnection for device {} was abandoned due to the operation timeout", deviceSessionToReconnect); | |||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not returning here meant that retry logic would continue even if we declare that retry has expired
@@ -1766,6 +1771,55 @@ private void updateStatus(IotHubConnectionStatus newConnectionStatus, IotHubConn | |||
else if (newConnectionStatus == IotHubConnectionStatus.DISCONNECTED) | |||
{ | |||
correlationCallbackCleanupThread.interrupt(); | |||
finalizeMultiplexedDevicesMessages(deviceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now when a multiplexed device reaches the DISCONNECTED state, we look for any of its messages in the outgoing queues and cancel them. This should address #1734
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Disconnected
followed byDisconnected_retrying
and then finallyDisconnected