wakeupprobe

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package wakeupprobe polls a container's HTTP wakeup endpoint from inside an ateom. The intent is to detect the moment a container's HTTP server starts accepting connections with single-millisecond latency: while the server is still booting the kernel returns RST in microseconds, so a sub-millisecond poll loop spends almost no time blocked, and once the listen socket is up the next iteration completes the GET on veth-local latency.

Index

Constants

View Source
const (
	RequestTimeout = 250 * time.Millisecond
	PollInterval   = 1 * time.Millisecond
)

Tuning knobs. Sized for actor cold-start where the HTTP server may take a few seconds to bind; HTTPClient below is a var so tests can substitute a transport that targets a test server's loopback address.

Variables

View Source
var HTTPClient = func() *http.Client { return newClient(nil) }

HTTPClient builds a keep-alive HTTP client tuned for fast, repeated probing of a single endpoint. Exposed as a var so tests can substitute a transport that targets a test server's loopback address.

Functions

func URL

func URL(probe *ateompb.WakeupProbe, actorIP string) (string, error)

URL builds the probe endpoint URL. Exported so callers and tests can validate a probe spec before kicking off a Wait.

func Wait

func Wait(ctx context.Context, containerName string, probe *ateompb.WakeupProbe, actorIP string, dial DialFunc) error

Wait polls the configured HTTP endpoint through dial until it returns 200, the context is cancelled, or the overall deadline is exceeded.

func WaitAll

func WaitAll(ctx context.Context, containers []*ateompb.Container, actorIP string, dial DialFunc) error

WaitAll blocks until every container with a wakeup probe set reports 200 through dial, or returns the first error. Containers without a probe are skipped (their absence means "no wakeup gate").

Types

type DialFunc

type DialFunc func(ctx context.Context, network, addr string) (net.Conn, error)

DialFunc reaches the actor, which lives in its own network namespace and is not addressable from the caller's. Nil dials from the caller's namespace.

Jump to

Keyboard shortcuts

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