Conversation
📊 API Diff Results
|
There was a problem hiding this comment.
🟢 Approval recommended
Only a minor metric-contract nit remains; no blocking issues were identified.
Pull request overview
Adds recovery for panics in asynchronous wasm capability and secrets calls, converting them into reported errors instead of terminating execution.
Changes:
- Recovers and normalizes panics from capability and secrets calls.
- Logs recovered panics and records host metrics.
- Adds regression tests for error propagation, awaiting, and limiter release.
File summaries
| File | Summary |
|---|---|
pkg/workflows/wasm/host/execution.go |
Adds recovery helpers for asynchronous execution. |
pkg/workflows/wasm/host/execution_panic_test.go |
Tests panic recovery and resource cleanup. |
Review details
Suppressed comments (1)
pkg/workflows/wasm/host/execution.go:140
- This records panics from
ExecutionHelpergoroutines inplatform_wasm_host_panic_recovered_total, but that counter is registered as counting recovered “wasmtime-go” panics (module_metrics.go:23-24). Async helper panics are a different source, so dashboards and alerts will misclassify this new failure mode; update the metric contract/description or use a separate counter before adding this increment.
e.module.metrics.IncHostFnPanicRecovered()
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@vreff Wasmtime will already be catching this panic for you, and then bubbling it back up to the call to module.Execute This gets caught here: and should stop the panicIf this isn't working for you, I'd love to understand more |
The issue seems to be that the capability call spins up a new goroutine and then returns nil immediately. What happens if that instance shuts down for some other reason, like a timeout, and then the goroutine it started panics? Problematic code: This just seems like a new goroutine, which is not guaranteed to be tracked by that wasm instance. |
This reverts commit 22ea6bc.
|
@cedric-cordenier I've reworked this PR as simply a test to show the behavior I'm concerned about. LMK if some aspect of the test is missing context. |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.
| Benchmark suite | Current: 67e2f77 | Previous: 22ea6bc | Ratio |
|---|---|---|---|
BenchmarkKeystore_Sign/nop/in-process |
836.3 ns/op |
232.6 ns/op |
3.60 |
This comment was automatically generated by workflow using github-action-benchmark.
Capability calls from the wasm host module spin up a goroutine to handle the call, then immediately return. Those goroutines seem to be unhandled by wasmtime if they panic.