reaper

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package reaper provides a background zombie process reaper.

When a Go process runs as PID 1 (e.g. inside a container), it inherits orphaned child processes. If those children exit without being waited on, they accumulate as zombies. This package periodically calls waitpid(-1) with WNOHANG to reap any such zombies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reap

func Reap(ctx context.Context)

Reap collects all currently-zombie child processes without blocking.

func Start

func Start(ctx context.Context)

Start launches a background goroutine that reaps zombie child processes. It only activates when the current process is PID 1. The goroutine exits when ctx is cancelled.

func StartForTest

func StartForTest(ctx context.Context)

StartForTest is like Start but skips the PID 1 check.

Types

This section is empty.

Jump to

Keyboard shortcuts

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