cleanup

package
v0.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package cleanup is the one place executor components classify resource release failures. It depends on nothing else in the executor, so a resource implementation and the constructor or factory that falls back from it can both use it without depending on each other.

Two questions are answered here:

  • Did a failure leave resources behind? ErrCleanupFailed and ErrCleanupUnconfirmed mark a failed packet counter construction whose rollback failed or could not be confirmed, so the factory refuses to fall back. They are matched with errors.Is.
  • Which part of a failure was the release? Join attaches the release failure of a rollback to the error that caused it, and Released projects that part back out, so a caller that does fall back can keep only the release failure for its own cleanup result.

Index

Constants

This section is empty.

Variables

View Source
var ErrCleanupFailed = errors.New("packet counter cleanup failed")

ErrCleanupFailed means an application-owned resource release returned an error. The returned error also retains each underlying release error for errors.Is.

View Source
var ErrCleanupUnconfirmed = errors.New("packet counter cleanup unconfirmed")

ErrCleanupUnconfirmed means the BPF loader failed and did not expose the result of its internally owned rollback. It does not assert that cleanup failed.

Functions

func Join

func Join(err, releaseErr error) error

Join returns err with the rollback failure releaseErr attached, or err alone when releaseErr is nil. errors.Is still finds both in the result; Released finds only releaseErr.

func Released

func Released(err error) error

Released returns the release failure attached to err, or nil when there is none, without treating the failure that caused the rollback as a cleanup failure. It recognises any error in the chain with a CleanupError() error method, so a test fixture can stand in for a constructor's result.

Types

This section is empty.

Jump to

Keyboard shortcuts

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