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

Exit() of child process not counted #48

Open
woytam opened this issue Dec 13, 2019 · 1 comment
Open

Exit() of child process not counted #48

woytam opened this issue Dec 13, 2019 · 1 comment

Comments

@woytam
Copy link

woytam commented Dec 13, 2019

I have found out, that if child process exited by function exit() with return code 0, it is not handled as process termination in flexible pool.
The reason is in code reactphp-child-process-messenger/src/Factory.php#L211, where for exitCode zero is not thrown error

if ($exitCode === 0) {
   return;
}

If child process calls exit(), Flexible pool will still count this child, although process is terminated.

There is question, how to resolve this. I have a few ideas:

  1. Is there important to ignore exitCode === 0 in Messenger?
  2. Try to catch exit event on React\ChildProcess\Process
  3. Add to documentation, it is important to Terminate child process with non-zero exit codes to keep Flexible pool working.
@WyriHaximus
Copy link
Owner

Well it was never designed to use exit() to be honest 🤐 . Will do 3 for sure and try to see if 2 is possible 👍

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

2 participants