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: after disconnect/connect, client twins should be pulled #4629

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

vipeller
Copy link
Contributor

Using mqtt broker upstream, after a disconnection to the parent device and connecting back, edge should pull the twin of the connected clients. This used to work by accident: there was a bug, which did not close existing cloud proxy objects, so they remained subscribed to connection events and forwarder those, so eventually twin manager received a notification that device_x regained its connection, which in turn pulled the twin.
Fixing this bug removed the accidental event forwarding of the dead object, and because on losing the connection these objects are removed, nothing forwarded events to twin manager for the individual devices.
This fix copies the solution of the legacy CloudConnection (ConnectToIotHub), which during proxy creation calls an explicit Open() method, which sends the notification about the device connected.

@vipeller vipeller added the area:edgehub Issue with Edge Hub label Mar 18, 2021
@kodiakhq kodiakhq bot merged commit 794c324 into Azure:master Mar 18, 2021
@vipeller vipeller deleted the vipeller/connected_event_fix branch March 23, 2021 21:59
vipeller added a commit to vipeller/iotedge that referenced this pull request Mar 24, 2021
)

Using mqtt broker upstream, after a disconnection to the parent device and connecting back, edge should pull the twin of the connected clients. This used to work by accident: there was a bug, which did not close existing cloud proxy objects, so they remained subscribed to connection events and forwarder those, so eventually twin manager received a notification that device_x regained its connection, which in turn pulled the twin.
Fixing this bug removed the accidental event forwarding of the dead object, and because on losing the connection these objects are removed, nothing forwarded events to twin manager for the individual devices.
This fix copies the solution of the legacy CloudConnection (ConnectToIotHub), which during proxy creation calls an explicit Open() method, which sends the notification about the device connected.

(cherry picked from commit 794c324)
kodiakhq bot pushed a commit that referenced this pull request Mar 24, 2021
…4669)

Using mqtt broker upstream, after a disconnection to the parent device and connecting back, edge should pull the twin of the connected clients. This used to work by accident: there was a bug, which did not close existing cloud proxy objects, so they remained subscribed to connection events and forwarder those, so eventually twin manager received a notification that device_x regained its connection, which in turn pulled the twin.
Fixing this bug removed the accidental event forwarding of the dead object, and because on losing the connection these objects are removed, nothing forwarded events to twin manager for the individual devices.
This fix copies the solution of the legacy CloudConnection (ConnectToIotHub), which during proxy creation calls an explicit Open() method, which sends the notification about the device connected.

(cherry picked from commit 794c324)
damonbarry pushed a commit to damonbarry/iotedge that referenced this pull request Apr 15, 2022
)

Using mqtt broker upstream, after a disconnection to the parent device and connecting back, edge should pull the twin of the connected clients. This used to work by accident: there was a bug, which did not close existing cloud proxy objects, so they remained subscribed to connection events and forwarder those, so eventually twin manager received a notification that device_x regained its connection, which in turn pulled the twin.
Fixing this bug removed the accidental event forwarding of the dead object, and because on losing the connection these objects are removed, nothing forwarded events to twin manager for the individual devices.
This fix copies the solution of the legacy CloudConnection (ConnectToIotHub), which during proxy creation calls an explicit Open() method, which sends the notification about the device connected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants