Skip to content
Permalink
Browse files

Ignore range issues with serialised message

  • Loading branch information...
muglug committed May 30, 2019
1 parent f9b509a commit 76bdfb7c7bb0c1d5b37149f06544885417771880
Showing with 2 additions and 10 deletions.
  1. +2 −10 src/Psalm/Internal/Fork/Pool.php
@@ -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
@@ -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);

0 comments on commit 76bdfb7

Please sign in to comment.
You can’t perform that action at this time.