Documentation
¶
Overview ¶
Package childowner retains control of one original started child until its single terminal Wait. Nothing here reconstructs authority from a stored PID.
Index ¶
- Variables
- func Available() error
- type Owner
- func (o *Owner) Active() bool
- func (o *Owner) OwnsUnreaped(cmd *exec.Cmd) bool
- func (o *Owner) Pause() error
- func (o *Owner) Paused() bool
- func (o *Owner) Resume() error
- func (o *Owner) RetirePressureControls()
- func (o *Owner) Signal(sig syscall.Signal) error
- func (o *Owner) TryOwnsUnreaped(cmd *exec.Cmd) bool
- func (o *Owner) TryPaused() (bool, bool)
- func (o *Owner) Wait(ctx context.Context) Result
- type Result
Constants ¶
This section is empty.
Variables ¶
var ErrPauseState = errors.New("original child pause state differs")
var ErrRetired = errors.New("original child control authority is retired")
Functions ¶
Types ¶
type Owner ¶
type Owner struct {
// contains filtered or unexported fields
}
Owner is process-local, never serialized or reconstructed after recovery. Its mutex serializes signals and the irreversible retirement before Wait.
func (*Owner) OwnsUnreaped ¶
OwnsUnreaped confirms the exact original command handle without exposing a PID as a reusable capability. It cannot restore ownership after Wait begins retiring signals, even if a stored row still contains the old number.
func (*Owner) Pause ¶
Pause and Resume control only this process-local original owner. They are separate from Signal so an already terminal leader cannot receive a late STOP or CONT through a reused numeric process group. The Manager reserves a validated lease/action/clock effect before calling either method.
func (*Owner) RetirePressureControls ¶
func (o *Owner) RetirePressureControls()
RetirePressureControls is a nonblocking end/revocation cut. It never retires TERM/KILL or the sole Wait needed to clean up the original child.
func (*Owner) TryOwnsUnreaped ¶
TryOwnsUnreaped lets a Manager holding its bookkeeping lock refuse a busy original observer immediately. It never waits for Owner.mu in that order.
func (*Owner) TryPaused ¶
TryPaused is a conservative snapshot for a Manager final fence. Busy owner observation withdraws the effect instead of blocking lease bookkeeping.
func (*Owner) Wait ¶
Wait observes the leader without reaping it. A terminal unreaped leader is still the original PID anchor while descendants receive the final KILL. Retirement precedes the sole native Wait; later callers can never signal a numeric PID that the OS may have reused. Signal/observation/join failures remain failures even when a later read appears healthy.