Documentation
¶
Overview ¶
Package procgroup stops the process groups that steps leave running in the background once the workflow that started them is over.
Index ¶
Constants ¶
const StopGrace = 3 * time.Second
StopGrace is how long a background process is given to exit on SIGTERM before it is killed.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker records the processes that steps start in the background, so that they can be stopped when the workflow is over. An action runs in a plugin process that exits as soon as the step is done, and the background process is put in a session of its own to survive that, so nothing else would ever stop it. A nil Tracker records nothing.
func (*Tracker) Begin ¶
func (b *Tracker) Begin() func()
Begin is called before an action that can start a background process runs, and the function it returns once the action has returned and its process, if any, has been tracked. Stop waits a moment for such actions to report.
func (*Tracker) Stop ¶
func (b *Tracker) Stop()
Stop terminates every recorded process and removes its log file.
func (*Tracker) StopOnSignal ¶
func (b *Tracker) StopOnSignal() func()
StopOnSignal stops the recorded processes when probe is interrupted, terminated or hung up on, and then lets the signal end probe as it would have. The background processes are in sessions of their own, so the signal never reaches them, and nothing else would stop them. The first signal restores the default handling, so a second one ends probe at once. The returned function ends the watch.