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

tedge-mapper-c8y status is reported as down in c8y if the built-in bridge disconnects #3075

Open
jarhodes314 opened this issue Aug 21, 2024 · 0 comments
Assignees
Labels
bug Something isn't working theme:c8y Theme: Cumulocity related topics

Comments

@jarhodes314
Copy link
Contributor

Describe the bug
In order for the tedge-mapper-c8y status to be set to down in Cumulocity, two things need to happen:

  1. The service_monitor_actor publishes the 102,... last will message to c8y/s/us
  2. The bridge receives forwards this message to Cumulocity

Previously when shutting down the mapper, the service status for tedge-mapper-c8y was accurately reported as down since the bridge was running separately in mosquitto. With the built-in bridge, however, it's hit or miss whether the bridge fully processes the message before shutting down. As a result, I modified the Cumulocity bridge's last will message to include a down message for both tedge-mapper-bridge-c8y and tedge-mapper-c8y. This fixes the mapper status reporting, ensuring that tedge-mapper-c8y is marked down in Cumulocity when the mapper is stopped.

The unintentional side-effect of this is that tedge-mapper-c8y is also reported as down whenever the bridge disconnects from Cumulocity, e.g. due to network flakiness. When the bridge reconnects, it updates its own health status to be up, but doesn't update the health status of tedge-mapper-c8y since the rest of the mapper is blind to the disconnection the bridge suffered, therefore tedge-mapper-c8y remains marked as down in Cumulocity until the mapper is restarted.

To Reproduce

  • Run the Cumulocity mapper with the built-in bridge enabled
  • Observe that both tedge-mapper-c8y and tedge-mapper-bridge-c8y are marked as up on the cloud device
  • Disconnect from the internet and wait for the bridge to log that it has disconnected from the cloud
  • Observe that both tedge-mapper-c8y and tedge-mapper-bridge-c8y are marked as down on the cloud device
  • Reconnect to the internet and wait for the bridge to log that it has reconnected
  • Observe that tedge-mapper-c8y is still marked as down on the cloud device

Expected behavior
tedge-mapper-c8y should not continue to be marked as down once the bridge has reconnected.

Screenshots
image

@jarhodes314 jarhodes314 added bug Something isn't working theme:c8y Theme: Cumulocity related topics labels Aug 21, 2024
@jarhodes314 jarhodes314 self-assigned this Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:c8y Theme: Cumulocity related topics
Projects
None yet
Development

No branches or pull requests

1 participant