-
Notifications
You must be signed in to change notification settings - Fork 56
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-log-plugin publishes service health status to main device when running on child device #2253
Comments
There is only one key point to clarify before implementation: How a service can know its topic identifier?
My proposal is to:
The
This approach will have then to be applied to all tedge daemons:
|
QA has thoroughly checked the feature and here are the results:
|
@reubenmiller Given this is now completed, I was surprised to discover that uncommenting thin-edge.io/tests/RobotFramework/tests/cumulocity/configuration/configuration_operation.robot Lines 304 to 305 in b216239
|
Describe the bug
When the tedge-log-plugin is not running as the main device it still reports the service health status to the main device, overwriting the status of the real tedge-log-plugin service status running on the main device.
Looking at the code
crates/extensions/tedge_health_ext/src/lib.rs
it clearly shows there is no logic to handle running as a child device or main device, and it blindly assumes it is always the main device.To Reproduce
Install thin-edge.io
Run the tedge-log-plugin as a child device (see the integration test under tests/RobotFramework/tests/cumulocity/log/log_operation_child.robot)
Subscribe to all topics (in the background)
Note: Press enter a few times afterwards so you get a prompt again.
Restart the
tedge-log-plugin
serviceInspect the console output. The tedge-log-plugin should publish its health message to either
tedge/health/tedge-log-plugin/<child-id>
orte/device/<child-id>/service/tedge-log-plugin/status/health
(depending if the new MQTT v1 api spec has been implemented or not)Expected behavior
The tedge-log-plugin should publish to the
tedge-log-plugin
attached to the child device it is running on, when the service is running as a child device.Screenshots
The following console output shows when the tedge-log-plugin was restarted on the child device, and that the
tedge/health/tedge-log-plugin
topic was incorrectly used as the published message also includes the PID of the tedge-log-plugin running on the child device,5010
.Environment (please complete the following information):
Debian bullseye
Docker
Linux 12bb2636811b 5.15.68-0-virt #1-Alpine SMP Fri, 16 Sep 2022 06:29:31 +0000 aarch64 GNU/Linux
0.12.1~266+g2eb30d5
Additional context
The text was updated successfully, but these errors were encountered: