Documentation
¶
Overview ¶
Package readyz polls a container's HTTP readiness 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 ( // DefaultOverallTimeout applies to probes that do not set // timeout_seconds. A workload that needs longer says so on its // ActorTemplate rather than having every actor wait as long. DefaultOverallTimeout = 30 * time.Second RequestTimeout = 250 * time.Millisecond PollInterval = 1 * time.Millisecond DefaultPath = "/readyz" )
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 { tr := &http.Transport{ DisableCompression: true, MaxIdleConnsPerHost: maxIdleConnsHost, DialContext: (&net.Dialer{Timeout: RequestTimeout}).DialContext, ResponseHeaderTimeout: RequestTimeout, } return &http.Client{Transport: tr, Timeout: RequestTimeout} }
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 ¶
URL builds the probe endpoint URL. Exported so callers and tests can validate a probe spec before kicking off a Wait.
func Wait ¶
Wait polls the configured HTTP endpoint until it returns 200, the context is cancelled, or the overall deadline is exceeded.
func WaitAll ¶
WaitAll blocks until every container with a readyz probe set reports 200, or returns the first error. Containers without a probe are skipped (their absence means "no readiness gate").
Every caller is an ateom RPC handler, so a %w-wrapped Reason dies here: errors.As cannot cross a process, and the interceptor would flatten it to a bare codes.Internal, leaving atelet reading UNKNOWN. The ErrorInfo detail is what carries it. Internal and no crash directive both match today's behavior.
Types ¶
This section is empty.