You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
kgilden
changed the title
No error handling in BatchJob
Errors not bubbling up from BatchJob
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, ifdebug
is set tofalse
. 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 inBatchJob
. If a fork failed for any reason, theFork::getResult()
would returnnull
and a PHP warning would be generated.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.The text was updated successfully, but these errors were encountered: