step.watchdog_manager¶
Watchdog manager — deadlines that cancel the main-mission task on expiry.
Two usage patterns share one manager:
Mission deadlines — armed automatically by the robot runner from a
Mission.time_budgetclass attribute. Never fed; expiry fires when the budget elapses.Keepalive watchdogs — armed/fed/disarmed imperatively by user code via the
start_watchdog/feed_watchdog/stop_watchdogsteps. Must be fed before their timeout or expiry fires.
On expiry, the manager cancels the registered main-mission task. This
routes through the existing shutdown path in _run_missions: background
tasks drain, the shutdown mission runs, then the process exits.
Attributes¶
Exceptions¶
Raised on the main-mission task when a watchdog expires. |
Classes¶
Track armed watchdogs and cancel the main-mission task on expiry. |
Functions¶
|
Get or create the |
Module Contents¶
- step.watchdog_manager.logger¶
- exception step.watchdog_manager.WatchdogExpiredError¶
Bases:
ExceptionRaised on the main-mission task when a watchdog expires.
- class step.watchdog_manager.WatchdogManager¶
Track armed watchdogs and cancel the main-mission task on expiry.
Attached to the robot instance as
robot._watchdog_manager. Wire the main-mission task viaattach_main_taskbefore arming anything so the manager knows what to cancel.- attach_main_task(task: asyncio.Task[None]) None¶
Register the task that should be cancelled when a watchdog fires.
- arm(name: str, timeout: float, source: str = 'user') None¶
Arm a watchdog. Replaces any existing entry with the same name.
- step.watchdog_manager.get_watchdog_manager(robot: object) WatchdogManager¶
Get or create the
WatchdogManagerattached to robot.