Report OpenSync restarts to cloud
General
Currently, process crashes are reported to cloud. However, full manager restarts are not reported, even though they can cause more significant network disruptions than simple manager restarts. To improve visibility, all full OpenSync restarts should be reported similarly to process crashes. The existing crash report MQTT topic and message format will be used. Minimal modifications will be made to the content of the fields only:
The
pidfield will be set to<NA>since there is no single process that will be restarted but all OpenSync managers.The
namefield will use a predefined identifier:OpenSync.The
reasonfield will contain the calling function which triggered the restart.
Since the functionality relies on the fact that OpenSync can be restarted, the TARGET_RESTART_SCRIPT kconfig must be enabled along with DM_OSYNC_CRASH_REPORTS which enables sending crash reports to the cloud.
Northbound API
MQTT
The
Crash/ReportsMQTT topic will be reused to send JSON-formatted reports for full OpenSync restarts.The existing JSON report structure will stay the same as the one used for process crashes.
Example JSON Report:
{ "nodeId": "ABCDEF1234", "locationId": "12345667898090", "firmwareVersion": "7.0.0-32599-aaa0bb-opensync", "model": "OS123", "pid": "<NA>", "name": "OpenSync", "reason": "OpenSync restarted by cm2_trigger_restart_managers", "timestamp": 1738838543963, "backtrace": "0 > 0xb6bcca00: os_backtrace 0x34 /usr/opensync/lib/libopensync.so\n 1 > 0xb6bccab8: os_backtrace_dump_generic 0xa4 /usr/opensync/lib/libopensync.so\n 2 > 0xb6bccedc: os_backtrace_dump_manager_restart 0xbc /usr/opensync/lib/libopensync.so\n 3 > 0xb6c6fc34: target_device_restart_managers_helper 0x50 /usr/opensync/lib/libopensync.so\n 4 > 0x1f874: cm2_trigger_restart_managers 0x1c0 /usr/opensync/bin/cm\n 5 > 0x2bdd4: (null) 0 /usr/opensync/bin/cm\n 6 > 0x2bfe4: cm2_connection_req_stability_check 0x8c /usr/opensync/bin/cm\n 7 > 0x20058: cm2_update_state 0x768 /usr/opensync/bin/cm\n 8 > 0xb6996fb4: ev_invoke_pending 0x7c /lib/libev.so.4\n 9 > 0xb6999530: ev_run 0x730 /lib/libev.so.4\n 10 > 0x1828c: main 0x1a8 /usr/opensync/bin/cm\n 11 > 0xb61c38cc: __libc_start_main 0x110 /lib/libc.so.6\n" }
Southbound API
No low-level functions are used, as this feature operates entirely at the OpenSync core level.
Requirements
There are no special requirements for this feature.