Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adaptation: honor context deadline in WASM runtime/plugins. #139

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

klihub
Copy link
Member

@klihub klihub commented Feb 4, 2025

Don't use the default wazero runtime configuration. Instead use one with `WithCloseOnContextDone(true) in order for calls to WASM plugins to properly obey context deadlines, which otherwise they don't. Also, once a WASM plugin is closed (for instance due to a request processing timeout), mark the plugin closed so it gets properly removed from the list of active plugins.

Fixes #138.

Don't use the default wazero runtime. Instead use one with
a ModuleConfig which has WithCloseOnContextDone(true) set.
This causes calls to WASM plugins to properly obey context
deadlines which otherwise they don't.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Don't try to make further calls to closed WASM plugins. Mark
them as closed in close(), so they get properly removed from
the list of plugins.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub klihub requested review from mikebrow and fuweid February 4, 2025 06:13
@klihub
Copy link
Member Author

klihub commented Feb 4, 2025

/cc @saschagrunert

Copy link
Contributor

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Thank you, great find!

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

@mikebrow mikebrow merged commit 8955028 into containerd:main Feb 5, 2025
8 checks passed
@klihub klihub deleted the fixes/wasm-honor-context-timeouts branch February 6, 2025 15:50
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.

WASM plugins do not honor request timeouts / context.
4 participants