Repository navigation
wasm: include environment_variables in vm_key to trigger VM recreation on change - #44563
Merged
kyessenov merged 5 commits intoMay 13, 2026
Merged
Conversation
derekargueta
marked this pull request as ready for review
April 21, 2026 21:17
…n on change When only the environment variables in vm_config changed, Envoy was silently reusing the existing VM rather than creating a new one. The proxy_wasm::makeVmKey function takes (vm_id, configuration, code), and none of those three captured environment_variables, so the key was identical before and after an env var update. Fix by serializing vm_config.environment_variables() and appending it to the code string before computing the key. Since we can't change the upstream makeVmKey signature, this is the cleanest lever available. Fixes envoyproxy#40881 Signed-off-by: Derek Argueta <[email protected]>
Signed-off-by: Derek Argueta <[email protected]>
derekargueta
force-pushed
the
dargueta-wasm-env-var-vm-key
branch
from
April 21, 2026 21:56
77ec51a to
0e17b8c
Compare
kyessenov
reviewed
Apr 28, 2026
| // since proxy_wasm::makeVmKey only accepts three parameters. | ||
| const std::size_t env_vars_hash = MessageUtil::hash(vm_config.environment_variables()); | ||
| auto vm_key = proxy_wasm::makeVmKey( | ||
| vm_config.vm_id(), |
Contributor
There was a problem hiding this comment.
nit: I think appending to vm_id is cheaper, since code is O(MB), you are causing a large allocation to append. I would also add a separator character in the append.
kyessenov
reviewed
Apr 28, 2026
kyessenov
left a comment
Contributor
There was a problem hiding this comment.
LGTM, but I think it could be slightly improved.
Appending the env vars hash to the code string caused a large allocation proportional to the Wasm binary size (O(MB)). Append to vm_id instead, which is a small string. Add a '|' separator to prevent key collisions between vm_id/hash boundary combinations. Signed-off-by: Derek Argueta <[email protected]>
Signed-off-by: Derek Argueta <[email protected]> # Conflicts: # changelogs/current.yaml
Signed-off-by: Derek Argueta <[email protected]>
kyessenov
approved these changes
May 13, 2026
jiaweiw02
pushed a commit
to jiaweiw02/envoy
that referenced
this pull request
May 15, 2026
…n on change (envoyproxy#44563) When only the environment variables in `vm_config` changed, Envoy was silently reusing the existing Wasm VM rather than creating a new one. `proxy_wasm::makeVmKey` takes `(vm_id, configuration, code)` — none of which captured `environment_variables` — so the key was identical before and after an env var update. The VM was only recreated on code changes. - Serialize `vm_config.environment_variables()` and append it to the `code` string before computing the vm_key. Since `makeVmKey` is in the upstream `proxy_wasm_cpp_host` library and its signature can't be changed, appending to `code` is the cleanest available lever. - Add a unit test (`VmCacheEnvVarChange`) verifying that two `createWasm` calls differing only in env vars produce distinct VM handles rather than a cache hit. Fixes envoyproxy#40881 Risk Level: low Testing: unit test added Docs Changes: N/A Release Notes: done Platform Specific Features: no --------- Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Jiawei Wu <[email protected]>
alrzazz
pushed a commit
to alrzazz/envoy
that referenced
this pull request
May 20, 2026
…n on change (envoyproxy#44563) When only the environment variables in `vm_config` changed, Envoy was silently reusing the existing Wasm VM rather than creating a new one. `proxy_wasm::makeVmKey` takes `(vm_id, configuration, code)` — none of which captured `environment_variables` — so the key was identical before and after an env var update. The VM was only recreated on code changes. - Serialize `vm_config.environment_variables()` and append it to the `code` string before computing the vm_key. Since `makeVmKey` is in the upstream `proxy_wasm_cpp_host` library and its signature can't be changed, appending to `code` is the cleanest available lever. - Add a unit test (`VmCacheEnvVarChange`) verifying that two `createWasm` calls differing only in env vars produce distinct VM handles rather than a cache hit. Fixes envoyproxy#40881 Risk Level: low Testing: unit test added Docs Changes: N/A Release Notes: done Platform Specific Features: no --------- Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Alireza <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 13, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` argument, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for envoyproxy#46893 are left out. Also left out here are the tests for changes not on this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The filter tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 13, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for envoyproxy#46893 are left out. Also left out here are the tests for changes not on this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The filter tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 13, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for envoyproxy#46893 are left out. Also left out here are the tests for changes not on this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The filter tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 13, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for envoyproxy#46893 are left out. Also left out here are the tests for changes not on this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) The gRPC call and stream test modules link `envoy_proxy_wasm_api_lib`, as this branch's combined test module did: with this branch's proxy-wasm C++ SDK their protobuf code imports `HaveOffsetConverter`, which that library defines (`GrpcCall` failed with "missing import: env.HaveOffsetConverter"). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for envoyproxy#46893 are left out. Also left out here are the tests for changes not on this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) The gRPC call and stream test modules link `envoy_proxy_wasm_api_lib`, as this branch's combined test module did: with this branch's proxy-wasm C++ SDK their protobuf code imports `HaveOffsetConverter`, which that library defines (`GrpcCall` failed with "missing import: env.HaveOffsetConverter"). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
that referenced
this pull request
Nov 17, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for #46893 are left out. Also left out here are the tests for changes not on this branch: the deferred data integration test and its Rust module (#44279), `VmCacheEnvVarChange` (#44563) and the `localWasmConfig()` config test helper (#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b50daf5) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 18, 2026
- reduce sharding and resource pools for wasm host tests - split wasm filter test and test modules by concern - only test first available engine in host tests (all engines still tested in compile-time-options) - additional tests to ensure coverage of runtime compilation --------- Backport note: as on release/v1.39, `getSha256Digest()` keeps this branch's `Buffer::Instance` signature, `Plugin` keeps its `TrafficDirection` and (here) listener metadata arguments, `envoy_wasm_cc_binary` keeps its `@envoy//` string labels, the proxy-wasm repositories keep this branch's names, and the tests for this branch: the deferred data integration test and its Rust module (envoyproxy#44279), `VmCacheEnvVarChange` (envoyproxy#44563) and the `localWasmConfig()` config test helper (envoyproxy#45242). The tests keep this branch's `absl::optional` and `absl::nullopt`, and `wee8_compile` keeps its summary output. Signed-off-by: Ryan Northey <[email protected]> Backport note (release/v1.37): as on release/v1.38, with this branch's `@com_google_absl` label, its `ParseFromArray` in the C++ test module, its `EXPECT_CALL` stream info mocks, and without the server context config test, which is not on this branch. The split tests are the 66 of this branch's `wasm_filter_test.cc`. (cherry picked from commit b50daf5) The gRPC call and stream test modules link `envoy_proxy_wasm_api_lib`, as this branch's combined test module did: with this branch's proxy-wasm C++ SDK their protobuf code imports `HaveOffsetConverter`, which that library defines (`GrpcCall` failed with "missing import: env.HaveOffsetConverter"). Signed-off-by: Ryan Northey <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When only the environment variables in
vm_configchanged, Envoy was silently reusing the existing Wasm VM rather than creating a new one.proxy_wasm::makeVmKeytakes(vm_id, configuration, code)— none of which capturedenvironment_variables— so the key was identical before and after an env var update. The VM was only recreated on code changes.vm_config.environment_variables()and append it to thecodestring before computing the vm_key. SincemakeVmKeyis in the upstreamproxy_wasm_cpp_hostlibrary and its signature can't be changed, appending tocodeis the cleanest available lever.VmCacheEnvVarChange) verifying that twocreateWasmcalls differing only in env vars produce distinct VM handles rather than a cache hit.Fixes #40881
Risk Level: low
Testing: unit test added
Docs Changes: N/A
Release Notes: done
Platform Specific Features: no