runwatch

package
v0.1.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package runwatch finds runs that stopped without finishing, such as runs whose coordinator was killed, and records them for the Web inbox. A run's own process cannot report that it was killed; rotari web looks for such runs instead. A run whose coordinator is on another host is judged by its heartbeat, which only suggests that it stopped.

Index

Constants

View Source
const Interval = 30 * time.Second

Interval is how often rotari web looks for interrupted runs.

View Source
const UnresponsiveAfter = state.HeartbeatStaleAfter

UnresponsiveAfter is how long a remote run's heartbeat must stay unchanged, by the watcher's own clock, before the run is reported unresponsive.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher added in v0.1.31

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher finds runs that stopped without finishing and records them for the Web inbox. A local run whose coordinator is dead is interrupted. An active run whose coordinator is on another host or in another PID namespace, which this host cannot check, is unresponsive once its heartbeat has not changed for UnresponsiveAfter. A Watcher remembers the heartbeats it saw between calls of Report, so one watcher must be kept for the life of the process; it is not safe for concurrent use.

func NewWatcher added in v0.1.31

func NewWatcher() *Watcher

NewWatcher returns a Watcher that has seen no heartbeat yet, so it calls no run unresponsive before UnresponsiveAfter has passed.

func (*Watcher) Report added in v0.1.31

func (watcher *Watcher) Report(log notificationlog.Log, baseDirs []string, now time.Time) (int, error)

Report records a run.interrupted notification for each run in baseDirs that project.Inspect finds interrupted, and a run.unresponsive one for each remote run whose heartbeat has stopped, unless the run already has one. A project whose state lock is held is looked at again on the next call. It returns how many notifications it recorded; a project it cannot inspect or record is an error that does not stop the others.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL