failpoint

package
v0.6.13 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package failpoint lets the live integration suite stop sandboxd at one exact point in a request, so a crash can land where a real one would do the most damage instead of wherever a SIGKILL from outside happens to fall.

It is compiled in only under the itest_failpoints build tag, which nothing but integration-tests/lib/build.sh sets (and only when AEROL_GO_TAGS asks). Every other build, release builds included, gets an empty Hit that the compiler inlines away (failpoint_off.go), so a call site costs nothing.

Protocol, under the tag: the suite writes a sandbox-name prefix to Dir/<name>. The first Hit(name, key) whose key starts with that prefix renames the file to Dir/<name>.hit (a failpoint fires once), writes the key into it, and blocks for the life of the process. The suite waits for the .hit file, which also tells it which node to kill, and SIGKILLs sandboxd there.

Index

Constants

View Source
const CreateBeforePersist = "create-before-persist"

CreateBeforePersist fires in Service.createSandbox after the runtime has created and started the sandbox and before its row is stored: a crash here leaves a running container, a held network slot and a placement reservation that no row records (UC-480). The key is the sandbox name.

View Source
const Dir = "/run/sandboxd/failpoints"

Dir is where armed failpoints live on a node. /run/sandboxd is made by the sandboxd unit's ExecStartPre (root, 0700) on tmpfs, so only root can arm one and none survives a reboot.

View Source
const HitSuffix = ".hit"

HitSuffix names the marker a fired failpoint leaves next to its file.

Variables

This section is empty.

Functions

func Hit

func Hit(name, key string)

Hit does nothing outside itest builds. It must stay an empty body: the compiler inlines it to nothing, which is what keeps the create path free of a file read in every release build.

Types

This section is empty.

Jump to

Keyboard shortcuts

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