streaming: wait 125% of the child reboot time before reporting it offline

Merged
ST
25d ago
+8-3
Summary

When a child disconnects, the parent waits before telling Cloud the child is offline. The intended wait is 125% of the child's reboot time, capped at 30 s (#18712). However, MAX_CHILD_DISC_TOLERANCE was (125 / 100), which is integer 1, so the parent waited only 100%. A child that reconnects in the remaining 25% window caused an avoidable offline/online pair in Cloud.

The change:

  • computes the delay as reboot time × 125 / 100, capping the reboot time first so the multiplication cannot overflow;
  • floors every schedule_node_state_update() delay at 10 ms. A child with no reboot time otherwise armed a 0 ms libuv timer, which #19810 avoided for the other callers.
Test Plan
  • Builds cleanly.
  • The other callers already pass 10 ms or more, so their delays are unchanged.

Summary by CodeRabbit

  • Bug Fixes
    • Scheduled node-state updates now observe a minimum delay of 10 ms, preventing shorter requested delays from being queued.
    • Child-disconnect update timing now applies a 25% tolerance to reboot time capped at 30 seconds, with the final delay also capped at 30 seconds. This avoids incorrect timing calculations and keeps disconnect delays within the intended limit.