Skip to content

fix: isolate worker-local Wasm failures - #13

Merged
johnlanni merged 2 commits into
masterfrom
codex/backport-worker-failure-isolation
Aug 11, 2026
Merged

fix: isolate worker-local Wasm failures#13
johnlanni merged 2 commits into
masterfrom
codex/backport-worker-failure-isolation

Conversation

@johnlanni

@johnlanni johnlanni commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • Keep thread-local plugin start, configure, and recovery failures on the affected worker generation instead of poisoning the shared base Wasm.
  • Make delayed cache eviction generation-safe and preserve the recovered plugin callback key and Higress bounded stale-cache bookkeeping.
  • Keep worker VM clone and initialization failures local, preserve their precise failure state, and publish only successful generations to the cache.
  • Add regression coverage for start/configure/recovery failures, worker clone/init failures, same-VM-key base reuse, cache isolation, delayed callbacks, and kill-safe destruction.

Compatibility

The result-returning worker creation API is additive; existing APIs are retained. The imported tests use the Higress fixture VM factory (makeVm(engine_)).

Validation

  • bazel test //test:wasm_test --define engine=v8 --test_output=errors --jobs=16 --local_cpu_resources=16 --loading_phase_threads=16 — 13 tests passed.

GitHub Actions checks are running.

Keep thread-local start, configure, and recovery failures on the affected local Wasm instead of poisoning the shared base. Guard Wasm and plugin cache eviction by generation identity so delayed callbacks cannot remove a replacement.

Restore the recovered plugin callback key, make plugin destruction tolerate killed Wasm handles, and preserve the Higress bounded stale-cache bookkeeping when publishing recovered handles.

(cherry picked from commit 3a5e47185fa58e33dcea93b1e92353b7a10dae2a)
Signed-off-by: zty98751 <zty98751@alibaba-inc.com>
Keep worker clone and initialization failures scoped to the thread-local generation instead of marking the shared base Wasm as failed. Preserve precise clone failure states, use a clone-local fallback for unclassified initialization failures, and keep cache publication success-only.

Extend the worker failure matrix to verify result propagation, base reuse, cache isolation, and recovery with the same VM key.

(cherry picked from commit a6272982e9f7262ba37f2c5f208bddd94ed0a45a)
Signed-off-by: zty98751 <zty98751@alibaba-inc.com>
@johnlanni
johnlanni merged commit d9c5587 into master Aug 11, 2026
2 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant