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

Improve timeout functionality #3

Open
nevinera opened this issue Jul 1, 2015 · 0 comments
Open

Improve timeout functionality #3

nevinera opened this issue Jul 1, 2015 · 0 comments

Comments

@nevinera
Copy link
Contributor

nevinera commented Jul 1, 2015

Right now the fork function accepts a 'timeout' option, and after that long has elapsed it will send a SIGKILL to the child.

Two approaches would be better.

  1. We could use a SIGTERM -> SIGKILL chain to allow well-behaved programs to terminate cleanly (ruby processes would typically raise a signal error, which would propagate back out to the parent, but even ffi code can clean up from a SIGTERM). The main drawback is the amount of race-condition and timing code that would need to be written and tested.
  2. We could allow the user to supply the signal type, so that the parent will send whatever signal is specified. This is pretty easy, and gets us most of the power, but without guaranteeing termination.

We could reasonably combine the two by allowing a set of timeouts and signals to be supplied, like { kill: 100, hup: 58 }, and manage all of the timeouts. Then we could interpret timeout: 10 to mean timeout: { kill: 11, term: 10 }.

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

No branches or pull requests

1 participant