﻿# systemd job timeouts cancel a waiting job rather than failing the unit

systemd job timeouts cancel a waiting job rather than failing the unit. A focused service-reliability guide with the documented mechanism, a reproducible validation scenario, evidence and operational limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/sre-job-timeout-waiter-unit-state/
Language: en

An automation task can stop waiting for a model service while the service itself continues changing state. systemd job deadlines and service startup deadlines act on different objects. Confusing them leads to a dangerous recovery assumption: a timed-out activation job is treated as proof that the model process was stopped, failed or never became available.

## The service-manager contract

The systemd.unit manual defines JobTimeoutSec as a deadline starting when a job is queued. JobRunningTimeoutSec starts when that queued job actually begins running. Reaching either cancels the job without itself changing the unit state or placing the unit in failed mode. The manual explicitly separates these limits from unit-specific controls such as TimeoutStartSec. JobTimeoutAction can request an additional action, so keep that policy explicit rather than assuming an unconfigured default applies everywhere.

## Implementation details

Capture job identity and queue time separately from unit identity, invocation and application readiness. Dependency ordering can consume queued-job time before the target start job runs. A caller whose wait expires must inspect the actual unit and avoid launching a duplicate worker merely because it lacks a successful waiting result. Use the service's own startup and stop contracts when process termination is required. Define how deployment automation reconciles a late success after the original caller stopped waiting.

## A constructed validation case

Construct an isolated activation graph with a deliberately slow prerequisite and a harmless target. Compare the total queued-job deadline with the running-job deadline, recording when each relevant job begins. Add a branch in which the target continues its state transition after a waiting job is cancelled, then inspect unit state and a synthetic functional probe independently. Contrast that with a service-specific startup timeout branch. Keep timeout actions neutral in this fixture and never use reboot actions for an editorial validation.

## Recovery limits

Cancellation of a wait is not rollback of side effects. Artifact downloads, external operations or a newly active process may still need reconciliation. The installed version and effective job action must accompany any observed outcome. Keep caller failure, unit failure and request failure as distinct records. These deadlines help bound orchestration waiting; they do not establish model accuracy, resource release or a universal maximum time until all consequences of activation have ended.

## Primary references

[systemd systemd.unit documented interface](https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html); [systemd systemd.service documented interface](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html).

This is a proposed service-lifecycle validation, not an executed Retrivium benchmark. Preserve the implementation version and unresolved outcomes; interface documentation does not establish the availability or correctness of an inference service.

## Related reading

[Find the service start limit behind a silent restart stop](/journal/guide-linux-systemd-restart-limit/); [Terminal request records: reconcile stream, usage and logs](/journal/provider-terminal-request-record-consistency/).
