Fail if unserialize
is unable to parse output of child process
#230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In
ParallelProcess
ingetOutput()
is checked if theunserialize
is successful.When it fails, is sets the
errorOutput
to the process output.async/src/Process/ParallelProcess.php
Lines 71 to 75 in c270e69
But this is not validated anymore because the check is already passed.
async/src/Process/ProcessCallbacks.php
Lines 35 to 50 in c270e69
Moving the
getOutput()
before the error output check will ensure all error output cases are handled properly.Adding extra checks on the output of the child processes, we can ensure the output of the task is not false or null, falsely triggering the
errorOutput
.By changing the
ChildRuntime
output to a predictable array ensures we can check if something is wrong with parsing the child processes output.