Documentation
¶
Index ¶
Constants ¶
View Source
const ( // GracePeriod is the time to wait after SIGTERM before sending SIGKILL. GracePeriod = 10 * time.Second // InitialBackoff is the initial delay before restarting after an abnormal exit. InitialBackoff = 5 * time.Second // MaxBackoff is the maximum delay between restarts. MaxBackoff = 10 * time.Minute // BackoffFactor is the multiplier for each successive backoff. BackoffFactor = 2.0 // SuccessRunTime is how long the child must run before backoff resets. SuccessRunTime = 30 * time.Second // DebounceInterval is the delay after an fsnotify event before checking the checksum. DebounceInterval = 100 * time.Millisecond // ScriptWaitTimeout is the maximum time to wait for the child to finish // running scripts after SIGUSR1 before falling back to SIGTERM+SIGKILL. // The script execution timeout is 5 minutes, so 6 minutes provides buffer. ScriptWaitTimeout = 6 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(extraArgs ...string)
Run starts the sentinel supervisor loop. It resolves the current executable path, starts a child process with the "run" subcommand, watches the binary for changes, and restarts the child on crash with exponential backoff. Any extra arguments are appended to the child's "run" command (e.g. "--prof"). This function blocks until SIGINT/SIGTERM is received.
Types ¶
Click to show internal directories.
Click to hide internal directories.