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 ¶
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 ¶
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").