Documentation
¶
Overview ¶
Package status implements status, sweep and doctor (spec 3.3).
Index ¶
Constants ¶
const StaleStaging = 6 * time.Hour
StaleStaging is the age after which sweep removes an artifact staging dir (spec 3.3).
Variables ¶
RemoteDoctor runs the --remote checks. unusable reports a configuration the host cannot run (an agent module_dir that is not a clean git tree): doctor exits 78 for it, not 69.
var RemoteSection func(e *config.Effective) any
RemoteSection fills Report.Remote (set by the remote status code).
var RemoteSweep func(ctx context.Context, e *config.Effective, dryRun bool, provider string, foreign bool, out io.Writer) error
RemoteSweep is the remote part of sweep.
Functions ¶
func Doctor ¶
Doctor prints "ok|warn|fail <check>: <detail>" lines; failed reports any fail (spec 3.3).
Types ¶
type Holder ¶
type Holder struct {
Job string `json:"job"`
Slot int `json:"slot"`
Pid int `json:"pid"`
Cwd string `json:"cwd"`
Argv []string `json:"argv"`
Provider string `json:"provider"`
Nested bool `json:"nested"`
Since string `json:"since"`
Legacy bool `json:"legacy,omitempty"` // a legacy shell-pool caller holds <legacy_dir>/locks/<pool>.<slot>.lock
}
type Report ¶
type Report struct {
Version string `json:"version"`
Time string `json:"time"`
Pools []Pool `json:"pools"`
Groups []Group `json:"groups"`
Memory Memory `json:"memory"`
Legacy []string `json:"legacy,omitempty"`
Remote any `json:"remote,omitempty"`
}
Report is `status --json` (docs/status.schema.json).
func Snapshot ¶
Snapshot reads tickets, locks and memory without taking any lock: holders come from /proc/locks on Linux and fcntl(F_GETLK) on darwin (lock.HeldRO; neither takes a lock), so a concurrent `--wait 0s` caller or a legacy `flock -n` never sees a lock made busy by status (read-only, best effort; except on a Linux without /proc/locks, see lock.HeldRO).