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(iot-dev): Fix 3 multiplexing scenario bugs #1753

Merged
merged 2 commits into from
Oct 20, 2023
Merged

Conversation

timtay-microsoft
Copy link
Member

@timtay-microsoft timtay-microsoft commented Oct 19, 2023

  • 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
  • Fix bug where terminal retry states (retry expired, non-retryable exception encountered, etc.) didn't end reconnection attempts

- 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;
Copy link
Member Author

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

@timtay-microsoft timtay-microsoft changed the title fix(iot-dev): Fix 2 multiplexing scenario bugs fix(iot-dev): Fix 3 multiplexing scenario bugs Oct 19, 2023
@@ -1766,6 +1771,55 @@ private void updateStatus(IotHubConnectionStatus newConnectionStatus, IotHubConn
else if (newConnectionStatus == IotHubConnectionStatus.DISCONNECTED)
{
correlationCallbackCleanupThread.interrupt();
finalizeMultiplexedDevicesMessages(deviceId);
Copy link
Member Author

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

@timtay-microsoft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@timtay-microsoft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@timtay-microsoft timtay-microsoft merged commit d547e53 into main Oct 20, 2023
25 of 27 checks passed
@timtay-microsoft timtay-microsoft deleted the timtay/muxFixes branch October 20, 2023 21:19
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.

2 participants