Skip to content

Commit

Permalink
fix(proxy-wasm) periodically sweep the root context store
Browse files Browse the repository at this point in the history
This frees trapped Wasm instances used by the root context (e.g.
`on_tick`) periodically instead of at worker shutdown. Trapped instances
from background ticks used to accumulate until OOM.
  • Loading branch information
thibaultcha committed Dec 11, 2023
1 parent fcde0ca commit e80eab3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/proxy_wasm/ngx_proxy_wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,9 @@ ngx_proxy_wasm_create_context(ngx_proxy_wasm_filter_t *filter,
log = filter->log;
store = filter->store;

/* sweep if an instance has trapped */
ngx_proxy_wasm_store_sweep(store);

} else {
/* filter context */
log = pwctx->log;
Expand Down

0 comments on commit e80eab3

Please sign in to comment.