Module lifecycle

Module lifecycle 

Source
Expand description

Plugin lifecycle (DW-056).

Load from config (path/registry ref, checksums); hot-swap on reload; plugin config schema validation; failure isolation.

Attachment: config selects plugins per route/service/global, applied in phase order per the DW-055 phase contract (section 9.3) – a route’s plugin chain is deterministic from its config, not load-order-dependent.

§Failure isolation

A crashed plugin returns 500 on affected routes only, never gateway-wide. The plugin lifecycle manager tracks which plugins are healthy and which routes use them. When a plugin crashes, only the routes that reference that plugin are affected. The dataplane reloads plugins with every config generation (DW-157): a plugin whose .wasm fails to read or compile is marked Crashed HERE, at load time, so routes referencing it fail closed from the first request of the new generation.

§Hot-swap on reload

When the config is reloaded, the lifecycle manager recompiles plugins that changed (by checksum) and swaps them in atomically. Plugins that did not change are reused (no recompilation).

This module compiles unconditionally in the OSS build — there are no cargo features for the plugin runtime.

Structs§

LoadedPlugin
A loaded plugin: its config, checksum, and health.
PluginLifecycle
The plugin lifecycle manager: tracks loaded plugins, their health, and which routes use them.

Enums§

LoadError
An error loading plugins. Per-plugin failures (an unreadable or uncompilable .wasm) do NOT appear here — they mark that plugin Crashed and the load succeeds (DW-157); only a failure that takes the whole plugin runtime down (wasmtime engine construction) does.
PluginHealth
A plugin’s health status.
ValidationError
A validation error for a plugin config.