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

Execjs will fail if the Ruby application/server reaps it's children manually. #68

Closed
boazsegev opened this issue Sep 22, 2017 · 0 comments

Comments

@boazsegev
Copy link

boazsegev commented Sep 22, 2017

When Ruby applications are used as the top process in a system (which can happen in certain containers), they must "reap" child processes.

Moreover, it's a good practice for web application servers to implement child reaping where the proficiency of the app developer is an unknown. Otherwise, a poorly designed app might result is a high zombie count that the kernel won't reap until the server is restarted.

When a developer / server implements this "reaping" in order to prevent zombie processes, the execjs gem will fail.

This failure will be caused by the gem's reliance on the special $? virtual variable that might be empty when a child process is reaped before pidwait is called (in the IO class, the IO#close calls pidwait).

An alternative approach to the $? testing is required to avoid this issue.

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

No branches or pull requests

1 participant