-
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
Bug fix: Direct method subscription not removed after disconnect #3359
Bug fix: Direct method subscription not removed after disconnect #3359
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
RemoveOldOperations is called at regular intervals to remove older pending twin operation tasks from our internal collection.
Unhooking the disconnection and received message event handlers in the same function isn't what you want to do, since what will happen here is, even without any disconnection event the handlers will get unhooked after a certain interval.
Instead, you need to unhook the message processor as a part of the transport handler's disconnection detection block.
Updated and unhooking the message processor as a part of the transport handler's disconnection detection block. |
What scenarios did you test for this? |
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.
Agree about adding a test, but otherwise makes sense.
…andler is only being triggered after disconnection
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
After a disconnect event, when the client reconnects, client subscribes to message receive event again resulting in multiple calls to direct method callback.
The root cause was missing unsubscription after a disconnect event.
github issue: #3354