Skip to main content

Module pool

Module pool 

Source
Expand description

Warm pool harness.

Keeps a configurable number of pre-restored microVMs alive per StackKey, refilled by a single background thread. The pool itself never speaks the Firecracker HTTP API directly — every state change is delegated to a VmProvider implementation (typically [microvm_runtime::FirecrackerVmProvider] in production, or microvm_runtime::InMemoryVmProvider in tests).

§Shutdown semantics

WarmPool::shutdown sets an atomic flag observed by the refill thread, joins with a 200 ms budget, then best-effort destroys every live entry. Mirrors the shutdown pattern used by microvm_runtime::metrics and microvm_runtime::console. Drop calls shutdown automatically.

Structs§

WarmPool
Warm pool of pre-restored microVMs.
WarmPoolConfig
Tunables for the pool’s refill scheduler and eviction policy.
WarmPoolHandle
A pre-restored VM checked out of the pool, ready for the caller to bring up under a new tenant identity.
WarmPoolMetrics
Snapshot of counters intended for Prometheus-style scraping. Cloned cheaply via WarmPool::metrics; no metrics library dependency by design.

Enums§

ValidationResult
Verdict returned by EntryValidator::validate.

Traits§

EntryValidator
Per-entry health probe, run synchronously on every WarmPool::acquire and after every successful refill spawn.