fix(uavcan): keep running when the time sync slave fails to start (#29255)

Run() returned with _node_mutex locked when the time sync slave failed to start, so the next work item on wq:uavcan to lock it (the node itself, or the ESC and servo outputs) blocked the work queue. It also returned before the teardown that uavcan stop waits for, so the destructor gave up after 50 ms and freed the node while _instance still pointed to it. Log the error and continue, as Run() already does with the node status monitor: the slave only lets the node follow a higher-priority time master, and the node keeps publishing its own time without it.

Assisted-by: Claude:opus-5.5

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé authored and GitHub committed 2026-10-16 16:47:03 -06:00
1 parent 997ba57dea
commit 06d3d0c400
1 file changed
+1 -2
+1 -2
View File
@@ -729,9 +729,8 @@ UavcanNode::Run()
const int slave_init_res = _time_sync_slave.start();
if (slave_init_res < 0) {
// not fatal: the slave only follows a higher-priority time master, the node keeps publishing its own time
PX4_ERR("Failed to start time_sync_slave");
ScheduleClear();
return;
}
/* When we have a system wide notion of time update (i.e the transition from the initial