Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(proxy-wasm) do not accidentally reset filter list from FFI call
When calling `proxy_wasm.set_property` from Lua, we want a `pwctx` to be able to store a property. But we need to do that before `proxy_wasm.start`, so `pwctx->ready` didn't have a chance to get initialized yet. Passing `NULL, 0` to `filter_ids` and `nfilters` when obtaining the `pwctx` from the `set_property` FFI call caused the `pwctx` to get initialized with an empty filter list, defeating the configuration previously set up by `proxy_wasm.attach`. In this fix, we make the `NULL` value of `filter_ids` to mean "please don't do the `pwctx->ready` initialization". The other use of `ngx_proxy_wasm_ctx` in `ngx_wasm_ops.c` always passes a non-NULL value (even when the filter list is empty), because the `elts` pointer is allocated on `ngx_array_init`. This issue caused an integration failure in Kong Gateway. This PR includes a regression test for our test suite, which reproduces the sequence observed in the Gateway; the test fails without the fix added to `ngx_proxy_wasm.c` and passes with the fix.
- Loading branch information
89170ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just dropping a note here as I write the changelog: I think this was a
hotfix
, fixing the initial fix of fake requests contexts freeing in e0f5a9f