Limitations of Azure DevOps Build Timeout for Background Tasks
0 reputation · 29 May 2026, 08:56 UTC
Goal
We want a pipeline job to terminate all running processes, including those started by a step, when the job exceeds its timeout or is canceled via the REST API.
Constraints & Uncertainty
The agent wrapper only tracks the main process started for a job. Child processes launched by a task (e.g., a long‑running background service) are not monitored, so they may continue to run after the job is marked as timed out or canceled. Azure DevOps does not expose an API or YAML directive to cancel individual steps or to signal child processes.
Questions
- Is there any built‑in mechanism in Azure DevOps to detect and kill orphaned child processes when a job times out or is canceled?
- Can the agent or task be configured to forward the cancellation signal to child processes, and if so, how?
- What best‑practice patterns or extensions exist to enforce fine‑grained cancellation of steps within a job?