Skip to main content

Module supervise

Module supervise 

Source
Expand description

Supervising a task process: waiting for it, its timeout, cancellation, and stopping it with SIGTERM, then SIGKILL after the grace time (see archive/PROJECT.md, Master–worker protocol: cancellation).

The logic works on the Process trait, so it is tested with a fake process and a paused clock; crate::process::OsProcess is the real one.

Structs§

Limits
The limits of one attempt.
Stops
The reasons to stop an attempt, in the order they come: the first decides its status; a drain’s interrupt after it only hurries its SIGKILL (B9). The agent keeps a StopSender for as long as the attempt runs.
Supervised
How a supervised process ended.

Enums§

Signal
A signal the agent sends to a task’s whole process group.

Constants§

STOP_POLL
How often a stopped process’s group is looked at, unless stop_poll says.

Traits§

Process
A running task process.

Functions§

supervise
Waits for process; on timeout, or at the first reason from stop (cancel, drain), sends SIGTERM to its group, and SIGKILL if it hasn’t ended after the grace time (the interrupt grace for a drain’s interrupt, also when the interrupt comes during another reason’s grace); over its memory budget (StopReason::OomKilled), SIGKILL at once.

Type Aliases§

StopSender
Sends an attempt its reasons to stop (cheap to clone).