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

Support timeout in manifest #74

Closed
mhmd-azeez opened this issue Jul 9, 2024 · 0 comments · Fixed by #78
Closed

Support timeout in manifest #74

mhmd-azeez opened this issue Jul 9, 2024 · 0 comments · Fixed by #78

Comments

@mhmd-azeez
Copy link
Collaborator

The other runtimes have a timeout for function calls that can be specified on the manifest. This is tricky to implement in the JS SDK as foreground plugins & background plugins (in Node) can't kill a rogue wasm function call. More details: #73 (comment)

chrisdickinson added a commit that referenced this issue Jul 16, 2024
This applies the timeout to both the initialization of the plugin and execution
of plugin methods. We have to be a little careful about leaving `MessagePort`
instances alive in Node.

Additionally: accept manifest options in snakeCase and accept memory settings
via plugin options.

Fixes #74.
chrisdickinson added a commit that referenced this issue Jul 16, 2024
This applies the timeout to both the initialization of the plugin and execution
of plugin methods. We have to be a little careful about leaving `MessagePort`
instances alive in Node.

It looks like the promise returned by `worker.terminate()` doesn't
ref() properly in Bun. We can work around this by keeping a timer
alive while we terminate the worker process.

However, that reveals that Bun appears not to be able to handle
halting Wasm execution in a thread. So -- for now, at least --
disable timeouts in Bun.

Additionally: accept manifest options in snakeCase and accept memory settings
via plugin options.

Fixes #74.
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 a pull request may close this issue.

1 participant