Skip to content

Commit

Permalink
Ignore range issues with serialised message
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed May 30, 2019
1 parent f9b509a commit 76bdfb7
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/Psalm/Internal/Fork/Pool.php
Expand Up @@ -133,11 +133,7 @@ public function __construct(
$task_result = $task_closure($i, $task_data);
$task_done_message = new ForkTaskDoneMessage($task_result);
$serialized_message = base64_encode(serialize($task_done_message)) . PHP_EOL;
$bytes_written = @fwrite($write_stream, $serialized_message);
if (strlen($serialized_message) !== $bytes_written) {
error_log('Could not send data to parent process, terminating.');
exit(self::EXIT_FAILURE);
}
fwrite($write_stream, $serialized_message);
}

// Execute each child's shutdown closure before
Expand All @@ -147,11 +143,7 @@ public function __construct(
// Serialize this child's produced results and send them to the parent.
$process_done_message = new ForkProcessDoneMessage($results ?: []);
$serialized_message = base64_encode(serialize($process_done_message)) . PHP_EOL;
$bytes_written = @fwrite($write_stream, $serialized_message);
if (strlen($serialized_message) !== $bytes_written) {
error_log('Could not send data to parent process, terminating.');
exit(self::EXIT_FAILURE);
}
fwrite($write_stream, $serialized_message);

fclose($write_stream);

Expand Down

0 comments on commit 76bdfb7

Please sign in to comment.