Skip to content
Permalink
Browse files

Ignore task done message error

  • Loading branch information...
muglug committed May 30, 2019
1 parent 76bdfb7 commit 2975642a7a9d2b820856c5e3e821b7cb539b5d36
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/Psalm/Internal/Fork/Pool.php
@@ -133,7 +133,8 @@ 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;
fwrite($write_stream, $serialized_message);
// don’t care if this message doesn’t get through
@fwrite($write_stream, $serialized_message);
}
// Execute each child's shutdown closure before
@@ -143,7 +144,11 @@ 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;
fwrite($write_stream, $serialized_message);
$bytes_written = @fwrite($write_stream, $serialized_message);
if (strlen($serialized_message) !== $bytes_written) {
error_log('Could not send ForkProcessDoneMessage to parent process, terminating.');
exit(self::EXIT_FAILURE);
}
fclose($write_stream);
@@ -264,11 +269,6 @@ private function readResultsFromChildren()
// If the stream has closed, stop trying to select on it.
if (feof($file)) {
if ($content[intval($file)] !== '') {
error_log('Child did not send full message before closing the connection');
$this->did_have_error = true;
}
fclose($file);
unset($streams[intval($file)]);
}

0 comments on commit 2975642

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