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

Errors not bubbling up from BatchJob #35

Open
kgilden opened this issue Sep 28, 2015 · 0 comments
Open

Errors not bubbling up from BatchJob #35

kgilden opened this issue Sep 28, 2015 · 0 comments

Comments

@kgilden
Copy link

kgilden commented Sep 28, 2015

This is related to https://github.com/symfony/assetic-bundle/issues/350.

I'm not an expert in how forking exactly works, but I think there might be a problem with BatchJob silently failing, if debug is set to false. In that case forks won't throw exceptions and promises must be used (this part here). However, there seems to be no error handling done in BatchJob. If a fork failed for any reason, the Fork::getResult() would return null and a PHP warning would be generated.

PHP Warning:  array_merge(): Argument #2 is not an array in /project/vendor/kriswallsmith/spork/src/Spork/Batch/BatchJob.php on line 96

Since BatchJob itself runs in a fork (i.e. we have [main process] <-> [batch job] <-> [n child processes]), wouldn't it make sense to throw an exception, if any of the child forks failed? Here's one way to do it, but hopefully more knowledgeable devs could take a look into it and propose a better fix.

@kgilden kgilden changed the title No error handling in BatchJob Errors not bubbling up from BatchJob Sep 28, 2015
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