killpoint

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 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 killpoint holds the migration FSMs' two test-only seams.

The kill point lets a live resume test deterministically simulate an abrupt kcp exit (a Ctrl-C, lost network, power loss) at a chosen point: it cancels the run context right after a named checkpoint and the run returns, leaving the world an exit at that point would leave. A real Ctrl-C ends the process wherever it is (kcp installs no signal handler); the kill point makes the stopping point exact.

The failure hook makes a named workflow step fail instead of running, so a live test can drive a step failure (and the rollback it triggers) deterministically. The step fails through the same handling a real failure of that step takes.

Both are inert unless their environment variable is set, so they never fire in production. Each env var is a per-invocation switch the e2e harness sets on the kcp process under test; a normal run never sets them.

Index

Constants

View Source
const AfterPromoteAccepted = "promote_accepted"

AfterPromoteAccepted is an intra-step checkpoint (not an FSM state name): it fires inside the promote loop right after a promote request is accepted (error_code 0) but before the mirror is confirmed STOPPED, leaving mirrors in PENDING_STOPPED — the state a resume must handle without re-promoting.

View Source
const EnvVar = "KCP_TEST_CANCEL_AFTER"

EnvVar names the checkpoint after which the run should cancel itself. When unset (the production default) the seam is inert. The value is a checkpoint token — for the FSM-boundary checkpoints, an FSM state name such as "fenced" or "promoted".

View Source
const FailEnvVar = "KCP_TEST_FAIL_AT"

FailEnvVar names the workflow step (an FSM event such as "verify_fence") the failure hook fails. When unset (the production default) the hook is inert.

Variables

This section is empty.

Functions

func FailAt

func FailAt(step string) error

FailAt returns an error when FailEnvVar names step, and nil otherwise. The FSMs call it as each step starts; a non-nil error fails the step in place of its action.

func ShouldCancelAfter

func ShouldCancelAfter(checkpoint string) bool

ShouldCancelAfter reports whether the run should cancel itself now that the given checkpoint has been reached. It is true only when EnvVar is set to exactly this checkpoint; unset or any other value is false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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