shutdown

package
v0.43.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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