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

Allowing to terminate a vm context/script #3690

Closed
mitar opened this issue Nov 6, 2015 · 2 comments
Closed

Allowing to terminate a vm context/script #3690

mitar opened this issue Nov 6, 2015 · 2 comments
Labels

Comments

@mitar
Copy link
Contributor

@mitar mitar commented Nov 6, 2015

So I would like to be able to terminate a script running in its vm context. So kill all resources allocated to it, all timers, stuff like that. I do not worry so much about busy loops or something, more that the code in vm would be listening to events and at some point outside code would like to clean it up, terminate it.

But it seems this is not possible. That the only thing is to specify a fixed timeout? But not that it should terminate on demand from outside (or inside even).

@bnoordhuis

This comment has been minimized.

Copy link
Member

@bnoordhuis bnoordhuis commented Nov 6, 2015

The timeout is to kill uninterruptible JS code (think infinite loops) but killing off everything associated with a context (like registered callbacks, timers, etc.) currently isn't possible and I'm not sure it's even possible to get to that level of isolation without completely separating VM contexts. If you need that kind of control, consider using child processes, possibly VM contexts in child processes.

@mscdex mscdex added the vm label Nov 6, 2015
@Fishrock123 Fishrock123 added the question label Nov 6, 2015
@cjihrig

This comment has been minimized.

Copy link
Contributor

@cjihrig cjihrig commented Nov 20, 2015

Closing this given @bnoordhuis's response.

@cjihrig cjihrig closed this Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.