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

Uncaught Exception in child process doesn't stop the EventLoop #167

Open
zenani007 opened this issue Mar 5, 2023 · 1 comment
Open

Uncaught Exception in child process doesn't stop the EventLoop #167

zenani007 opened this issue Mar 5, 2023 · 1 comment
Labels

Comments

@zenani007
Copy link

zenani007 commented Mar 5, 2023

Hi,

i think i have found a problem. If the child process throws an uncought exception and is running some repeated tasks or coroutines
I would expect the child process to end if there is an uncought exception and that there is an ContextException thrown in the parent process.

The result ist that the child.php is running forever the repeated task and the main process waiting for the child.php to end.

Without the repeated callback the ContextException is thrown in the main process and the script ends.

I tried to find the problem, but i'am not sure how to solve it:
The runContext() from Context/Internal/functions.php catches the exception and sends an ExitFailure back to the parent process, but the EventLoop::run() at the end of the function is running forever, because of the repeated callback.

The main process receives the exit result, but the join() from ProcessContext never ends, because the child process is still running.

I attached two example files to reproduce the problem.
test.txt
child.txt

@kelunik kelunik added the bug label Mar 28, 2023
@kelunik
Copy link
Member

kelunik commented Mar 28, 2023

Hi @zenani007, I agree that this should likely stop the child context and explicitly stop the event loop.

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

No branches or pull requests

2 participants