Kong / ngx_wasm_module

Nginx + WebAssembly
Apache License 2.0
80 stars 7 forks source link

fix(proxy-wasm) use pwexec pool in ngx_proxy_wasm_maps_set #456

Closed hishamhm closed 9 months ago

hishamhm commented 9 months ago

Use the pwexec pool (which is per-request in lower isolation modes) rather than the persistent instance pool in ngx_proxy_wasm_maps_set.

This fixes a memory-hoarding issue observed when filters set headers on every request.

hishamhm commented 9 months ago

This should fix the memory growth issues observed by @tonydongkong in his tests.

codecov[bot] commented 9 months ago

Codecov Report

Merging #456 (5f9e8d9) into main (bd1b5b8) will increase coverage by 0.00229%. Report is 4 commits behind head on main. The diff coverage is 100.00000%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/456/graphs/tree.svg?width=650&height=150&src=pr&token=T0PT2Q9IAN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong)](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) ```diff @@ Coverage Diff @@ ## main #456 +/- ## =================================================== + Coverage 90.18899% 90.19128% +0.00229% =================================================== Files 46 46 Lines 8572 8574 +2 =================================================== + Hits 7731 7733 +2 Misses 841 841 ``` | [Files](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | Coverage Δ | | |---|---|---| | [src/common/proxy\_wasm/ngx\_proxy\_wasm\_maps.c](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong#diff-c3JjL2NvbW1vbi9wcm94eV93YXNtL25neF9wcm94eV93YXNtX21hcHMuYw==) | `92.85714% <100.00000%> (+0.04891%)` | :arrow_up: |
thibaultcha commented 9 months ago

Nice!