1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Ignore task done message error

This commit is contained in:
Brown 2019-05-30 14:10:22 -04:00
parent 76bdfb7c7b
commit 2975642a7a

View File

@ -133,7 +133,8 @@ class Pool
$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);
// dont care if this message doesnt get through
@fwrite($write_stream, $serialized_message);
}
// Execute each child's shutdown closure before
@ -143,7 +144,11 @@ class Pool
// 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 @@ class Pool
// 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)]);
}