fix(go): prevent silent crash during concurrent WASM recovery - #515
Closed
fabriziodemaria wants to merge 1 commit into
Closed
fix(go): prevent silent crash during concurrent WASM recovery#515fabriziodemaria wants to merge 1 commit into
fabriziodemaria wants to merge 1 commit into
Conversation
Hold a mutex across RecoveringResolver operations so recreation cannot close a WASM instance while another resolve is in flight. Panic instead of caching nil WASM function handles so recovery converts silent process death into a handled evaluation error.
fabriziodemaria
marked this pull request as ready for review
August 11, 2026 08:14
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.
Summary
RecoveringResolveroperations with a mutex so WASM instance recreation cannot close an instance while another resolve is still running on it.withRecoverturns follow-on failures into evaluation errors instead of silent process death.Motivation
When a WASM guest trap triggers recovery, the old wazero instance was closed in a background goroutine while another resolve on the same pooled slot could still be mid-call.
Module.ExportedFunctionon a closed instance returns nil, which was cached infnCacheand later dereferenced — producing exit code 139 with no Go traceback.Test plan
go test ./confidence/internal/local_resolver/... -run 'RecoveringResolver|ExportedFunction'go build ./...Related
Made with Cursor