You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sandbox execution stack was fixed at WASM_STACK_SIZE (512 KB). The
module already carried a stack_size field and module_init already honored
a non-zero value (falling back to WASM_STACK_SIZE), but the size was
hardcoded to 0, so it was always the default.
Expose it as an optional "stack-size" route config field (bytes). It is
parsed into route_config, passed through module_alloc/module_init, rounded
up to a page, and flows into per-sandbox allocation via the existing
wasm_stack_alloc(module->stack_size). Omitting it (or 0) keeps the
WASM_STACK_SIZE default, so existing specs are unaffected.
Granularity is per-module (keyed by the .so path) because the stack pool
is sized per-module; a true per-route size for a shared module would break
the pool. The first route to create a module sets its stack size; a later
route requesting a different size for an already-created module is warned
and the existing size is kept. Preprocess modules use the default.
Verified: builds; applied size tracks the config exactly (1 MB -> 1048576,
16 KB -> 16384), omitting the field yields the 524288 default, and an
unmodified spec still serves resize requests byte-identically (10/10).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments