The Lease Timeout That Hands One Trailer to Two Robots

The cross-dock incident that keeps coming back is usually caused by two numbers that never appear in the same diff: the fleet manager's zone lease TTL and the robot's own communication-loss watchdog. Each value looks reasonable on its own, and each passes review in its own repository. Together they let the scheduler release a trailer zone while the robot holding it is still moving inside a steel box with no radio link.

Why the container breaks the assumption

A loaded container behaves like a decent Faraday cage, and the closer an unloader gets to the nose, the longer its heartbeats disappear. The fleet manager reads a missing heartbeat as lease expiry. With a TTL of 4 s and no renewal, the zone goes back to the pool and the next job in the queue can claim that trailer. The robot runs a separate watchdog that decides when a lost link means stop, and if someone raised it above the TTL to cut nuisance halts during a firmware rollout, there is a window where the scheduler thinks the trailer is free while the robot still believes it owns it. The second AGV arrives at the ramp, its safety scanner catches the first one, and the report says near miss, scanner worked, which is true and also hides the cause.

Why review never catches it

The diff that raised the watchdog touched a vehicle parameter file and was reviewed by the vehicle team for nuisance stops and ramp behaviour. The lease TTL lives in a fleet service config owned by another team, no reviewer ever holds both, and safety standards for driverless industrial trucks, such as ISO 3691-4, ask you to validate the vehicle's protective stop rather than the coordination contract between the vehicle and the scheduler, so certification evidence does not cover the gap either.

The rule and the check you can run today

The decision rule: the lease TTL must be greater than the robot's comm-loss watchdog, plus worst-case braking and settling time on a loaded ramp, plus a margin for clock skew between robot and server. It must also sit clearly above the longest real blackout, or you will get reassignment churn. To see where you stand, run this against your heartbeat store, assuming Postgres and a table with robot_id, ts and zone: SELECT robot_id, max(age(ts, prev)) AS worst_gap FROM (SELECT robot_id, ts, zone, lag(ts) OVER (PARTITION BY robot_id ORDER BY ts) AS prev FROM heartbeats) h WHERE zone LIKE 'trailer%' GROUP BY robot_id ORDER BY worst_gap DESC LIMIT 20; Compare the top rows with the TTL, and treat any robot whose worst trailer gap comes close to it as running on luck. Next, read the watchdog value from what is actually deployed on each vehicle variant, not the default in the repository, and check the inequality. Finally, put the same comparison in the CI of both repositories, each pulling the other side's value as a pinned artifact, so a change on either side fails the build.

Make expiry a suspicion, not a release

The stronger fix removes the race instead of tuning it. When a lease expires, the zone moves to a quarantined state that no dispatch can claim until the robot reconnects and reports a pose outside the zone, or an operator clears it at the dock. When a robot dies inside a container, only that door stops, the other doors keep flowing, and the scheduler can no longer route a second vehicle into an occupied trailer. The cost is throughput: every false blackout now parks a door until the robot reconnects, and by rough estimate a deep unload can lose tens of seconds of recovery per event. That moves the next decision to the RF side, where you either put a repeater or leaky feeder on the ramp, or accept quarantine time as the price of never letting two machines believe they own the same trailer.

Why not just raise the lease TTL and move on?

A longer TTL restores the inequality for now, but it delays detection of robots that are actually dead, and it still releases the zone on expiry. The next person to tune the watchdog brings the same incident back, so the TTL change only works alongside the CI check and quarantine on expiry.

Back to DockSwarm · Domains

← Back to DockSwarm
Engineering & Architecture Brief

The Lease Timeout That Hands One Trailer to Two Robots

The cross-dock incident that keeps coming back is usually caused by two numbers that never appear in the same diff: the fleet manager's zone lease TTL and the robot's own communication-loss watchdog. Each value looks reasonable on its own, and each passes review in its own repository. Together they let the scheduler release a trailer zone while the robot holding it is still moving inside a steel box with no radio link.

Why the container breaks the assumption

A loaded container behaves like a decent Faraday cage, and the closer an unloader gets to the nose, the longer its heartbeats disappear. The fleet manager reads a missing heartbeat as lease expiry. With a TTL of 4 s and no renewal, the zone goes back to the pool and the next job in the queue can claim that trailer. The robot runs a separate watchdog that decides when a lost link means stop, and if someone raised it above the TTL to cut nuisance halts during a firmware rollout, there is a window where the scheduler thinks the trailer is free while the robot still believes it owns it. The second AGV arrives at the ramp, its safety scanner catches the first one, and the report says near miss, scanner worked, which is true and also hides the cause.

Why review never catches it

The diff that raised the watchdog touched a vehicle parameter file and was reviewed by the vehicle team for nuisance stops and ramp behaviour. The lease TTL lives in a fleet service config owned by another team, no reviewer ever holds both, and safety standards for driverless industrial trucks, such as ISO 3691-4, ask you to validate the vehicle's protective stop rather than the coordination contract between the vehicle and the scheduler, so certification evidence does not cover the gap either.

The rule and the check you can run today

The decision rule: the lease TTL must be greater than the robot's comm-loss watchdog, plus worst-case braking and settling time on a loaded ramp, plus a margin for clock skew between robot and server. It must also sit clearly above the longest real blackout, or you will get reassignment churn. To see where you stand, run this against your heartbeat store, assuming Postgres and a table with robot_id, ts and zone: SELECT robot_id, max(age(ts, prev)) AS worst_gap FROM (SELECT robot_id, ts, zone, lag(ts) OVER (PARTITION BY robot_id ORDER BY ts) AS prev FROM heartbeats) h WHERE zone LIKE 'trailer%' GROUP BY robot_id ORDER BY worst_gap DESC LIMIT 20; Compare the top rows with the TTL, and treat any robot whose worst trailer gap comes close to it as running on luck. Next, read the watchdog value from what is actually deployed on each vehicle variant, not the default in the repository, and check the inequality. Finally, put the same comparison in the CI of both repositories, each pulling the other side's value as a pinned artifact, so a change on either side fails the build.

Make expiry a suspicion, not a release

The stronger fix removes the race instead of tuning it. When a lease expires, the zone moves to a quarantined state that no dispatch can claim until the robot reconnects and reports a pose outside the zone, or an operator clears it at the dock. When a robot dies inside a container, only that door stops, the other doors keep flowing, and the scheduler can no longer route a second vehicle into an occupied trailer. The cost is throughput: every false blackout now parks a door until the robot reconnects, and by rough estimate a deep unload can lose tens of seconds of recovery per event. That moves the next decision to the RF side, where you either put a repeater or leaky feeder on the ramp, or accept quarantine time as the price of never letting two machines believe they own the same trailer.

Technical FAQ: Why not just raise the lease TTL and move on?

A longer TTL restores the inequality for now, but it delays detection of robots that are actually dead, and it still releases the zone on expiry. The next person to tune the watchdog brings the same incident back, so the TTL change only works alongside the CI check and quarantine on expiry.

Related Architecture Specifications (ROBOTICS): roboticpresence.com · assembleswarm.com · facilityamr.com

More Technical Articles on dockswarm.com

Automating Intermodal Freight Transfers with Cooperative Heavy-Duty AMRs →Mitigating Slip and Dynamic Shift in Container Yard Autonomous Transport →The Cached Reservation That Lets a Yard Robot Keep Moving →