Skip to content

fix: add timeout to WASM plugin verification to prevent indefinite blocking#147

Merged
traefiker merged 2 commits into
traefik:masterfrom
mmatur:fix/wasm-timeout
Apr 23, 2026
Merged

fix: add timeout to WASM plugin verification to prevent indefinite blocking#147
traefiker merged 2 commits into
traefik:masterfrom
mmatur:fix/wasm-timeout

Conversation

@mmatur

@mmatur mmatur commented Apr 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a runWithTimeout helper that wraps any function with a hard timeout via goroutine + select, since wazero does not respect
    context.Context deadlines during module instantiation
  • Wrap checkWasmMiddleware with a 10s timeout (aligned with the existing Yaegi verification timeout), preventing piceus from hanging
    indefinitely when a WASM plugin makes blocking network calls during initialization
  • Pass context.Context into checkWasmMiddleware for future-proofing, even though wazero currently ignores it

Fixes #146

@darkweaver87 darkweaver87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@traefiker traefiker merged commit 0a7ad2b into traefik:master Apr 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug/fix a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove jannschu/maintenance-response from blacklist

4 participants