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-device): fix issue with direct method after reconnect from temporary network disconnect - AMQP #1577

Merged
merged 2 commits into from
Jul 21, 2022

Conversation

tmahmood-microsoft
Copy link
Contributor

@tmahmood-microsoft tmahmood-microsoft commented Jul 20, 2022

DeviceClient doesn't fully reconnect after temporary network disconnect (AMQP), attempts to invoke direct method fails.
Removed unnecessary boolean which were intended to carry over state between reconnection.

With each reconnection, we instantiate new SessionHandler but only set the boolean to true (and create method/twin links) when sending first message during initial connection, thus during reconnection we never create method/twin links.

github issue: #1571

Checklist

Reference/Link to the issue solved with this PR (if any)

Description of the problem

Description of the solution

…mporary network disconnect - AMQP

DeviceClient doesn't fully reconnect after temporary network disconnect (AMQP), attempts to invoke direct method fails.
Removed unnecessary boolean which were intended to carry over state between reconnection.

With each reconnection, we instantiate new SessionHandler but only set the boolean to true (and create method/twin links) when sending first message during initial connection, thus during reconnection we never create method/twin links.
@tmahmood-microsoft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

…isconnect - AMQP

reverting changes to AmqpsSessionHandler (e3558d2) and making sure after closing amqp connection due to transport error, we save previous AmqpsSessions so that their twin/methods subscriptions can persist.
@tmahmood-microsoft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link
Member

@timtay-microsoft timtay-microsoft left a comment

Choose a reason for hiding this comment

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

Code change looks good. I'm assuming you've run this test locally and seen that the SDK recovers subscriptions even when onTransportError throws the network loss error?

@tmahmood-microsoft
Copy link
Contributor Author

Code change looks good. I'm assuming you've run this test locally and seen that the SDK recovers subscriptions even when onTransportError throws the network loss error?

Yes, I was able to test locally and confirm that SDK recovers subscriptions as we do not lose SessionHandler object

@timtay-microsoft
Copy link
Member

Code change looks good. I'm assuming you've run this test locally and seen that the SDK recovers subscriptions even when onTransportError throws the network loss error?

Yes, I was able to test locally and confirm that SDK recovers subscriptions as we do not lose SessionHandler object

Perfect. Then you are all good to merge.

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