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

Add ability to refresh wasm middleware without restart #2267

Closed
codefromthecrypt opened this issue Nov 10, 2022 · 7 comments
Closed

Add ability to refresh wasm middleware without restart #2267

codefromthecrypt opened this issue Nov 10, 2022 · 7 comments
Labels
kind/enhancement New feature or request stale

Comments

@codefromthecrypt
Copy link
Contributor

Describe the feature

WebAssembly has an interesting ability to be safely reloadable. I suspect we should have either an implicit file watch, or another control to allow refreshing the wasm without restarting the sidecar.

Release Note

ADD HTTP wasm middleware can now be configured with watchPath: true to reload the wasm binary upon change.

@codefromthecrypt codefromthecrypt added the kind/enhancement New feature or request label Nov 10, 2022
@codefromthecrypt
Copy link
Contributor Author

cc @daixiang0 @ItalyPaleAle @anuraaga for ideas.. maybe swap out this function with some go atomic ref? https://github.com/dapr/components-contrib/blob/master/middleware/http/wasm/httpwasm.go#L148

@codefromthecrypt
Copy link
Contributor Author

prior art might be helpful too..

@antJack do you know if mosn does hot-reloading of proxy-wasm plugins? @anuraaga do you know on envoy?

@codefromthecrypt
Copy link
Contributor Author

the primary use case I'm thinking of right now is just development, as it is intuitive to have the server reload if you re-compile the wasm path dapr/samples#122

@anuraaga
Copy link

anuraaga commented Nov 10, 2022

@codefromthecrypt If I'm not mistaken, Envoy doesn't have anything specific for wasm, so not based on file change but a hot restart can be triggered manually with some complexity (it's a process swap though, not a in-process reload)

envoyproxy/envoy#156

@ItalyPaleAle
Copy link
Contributor

ItalyPaleAle commented Nov 11, 2022

I have mixed opinions about this feature.

On one hand, I can see how this could be helpful during development

On the other hand, if used in production, it could lead to unintended consequences as it would essentially allow changing the code that's being executed on-the-fly. When your app scales horizontally, you also need to ensure consistency there.

What do maintainers (CC: @yaron2 @berndverst ) think?

As an aside, you can use dapr/kit/fswatcher to implement a inotify-based watcher.

@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale label Dec 11, 2022
@codefromthecrypt
Copy link
Contributor Author

I think it is ok until users request this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

4 participants