vm support for timeout , is it a total blocking timeout ? #5674

Closed
orenz opened this Issue Jun 12, 2013 · 6 comments

4 participants

@orenz

Thanks for this parameter, It's really important !!!

However, we need this parameter to relate to the total blocking time, not the time it takes to exit.

We do not want to allow an unsafe script to block our CPU for 1000ms, however we want to allow it to wait for a remote site to answer for even longer.

Thanks !

@bnoordhuis
Node.js Foundation member

I'm not sure I'm following. You want a timeout based on CPU time rather than wall clock time?

@orenz
@bnoordhuis
Node.js Foundation member

It's possible but hard to implement cross-platform. Don't expect it in the near future.

If you only care about UNIX systems, you could implement it yourself as a native add-on that polls getrusage() from a watchdog thread.

@orenz
@isaacs

@orenz As @bnoordhuis pointed out, it's not impossible, and not a bad idea, but it's very challenging and not likely to land any time soon. You can pursue this yourself in a native addon.

@chrisdickinson

Closing this as it seems like it's best addressed in a separate native addon npm package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment