An orchestrator manages a pipeline where Agent B typically completes in under 10 minutes. On a production run, the orchestrator does not receive a completion signal from Agent B after 45 minutes. The orchestrator cannot determine if Agent B is still working slowly, has crashed silently, or is stuck in an infinite loop. Which detection mechanism would enable the orchestrator to reliably identify and respond to a stalled Agent B?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Waiting indefinitely for an agent to finish is like waiting for a package that might have been lost with no tracking number. Heartbeat signals are the tracking number: every 2 minutes, Agent B checks in — 'still alive, currently at step 4 of 7.' Silence for 5 minutes is the alert. This is how you distinguish 'working slowly' from 'completely stuck' without blind timeouts that kill legitimate long-running work.
Full explanation below image
Full Explanation
The core challenge is distinguishing three failure modes that are externally indistinguishable without additional instrumentation: 1. Working slowly but correctly: Agent B is processing a larger-than-typical dataset — 45 minutes is unusual but not wrong 2. Silent crash: Agent B's process died without sending a completion or error signal 3. Infinite loop: Agent B is running but circling on the same action without making progress
A heartbeat mechanism differentiates these: - Heartbeat missing: Indicates cases 2 (crash) or 3 (loop without progress reporting) — stall response triggered - Heartbeat present with advancing progress: Indicates case 1 — orchestrator waits patiently - Heartbeat present with non-advancing progress: Indicates case 3 (infinite loop at a fixed step) — stall response triggered
The heartbeat payload (current step, records processed) makes the mechanism multi-dimensional, not just a liveness check.
Option A (hard 15-minute deadline) eliminates ambiguity by force, but terminates legitimate slow runs. If Agent B occasionally takes 14 minutes for large datasets, a 15-minute deadline creates frequent false positives that break valid pipelines. Option C (output polling comparison) cannot detect stalls where Agent B is producing output but not progress — for example, writing the same log message in an infinite retry loop. It also adds a dependency on being able to read Agent B's intermediate output, which may not be architecturally available. Option D (auto-scaling restart) handles crash detection at the infrastructure level but does not inform the orchestrator, does not detect infinite loops (the process is running), and does not preserve the stall context needed for the orchestrator to decide how to respond (escalate, retry, or fail the pipeline).