shutdown

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 5 Imported by: 0

Documentation

Overview

Package shutdown tracks daemon-wide graceful shutdown state. The daemon command marks shutdown started when SIGTERM/SIGINT is received; the "ipfs diag healthy" subcommand checks this state for Dockerfile HEALTHCHECK and other monitoring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseWithCtx

func CloseWithCtx(ctx context.Context, name string, close func() error) error

CloseWithCtx runs close in a goroutine and returns when it finishes or when ctx is done, whichever comes first. If ctx fires before close returns, the goroutine is leaked intentionally; the process is about to exit, so the leak is bounded by process lifetime. Logs at ERROR which subsystem failed to close in time so operators see it in journal/docker logs.

func InProgress

func InProgress() bool

InProgress reports whether shutdown has been initiated.

func MarkStarted

func MarkStarted() bool

MarkStarted records that graceful shutdown has begun. Safe to call multiple times concurrently; only the first call wins. Returns true on the first call, false on subsequent calls.

func StartedAt

func StartedAt() time.Time

StartedAt returns when shutdown began, or the zero time if not started.

Types

This section is empty.

Jump to

Keyboard shortcuts

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