Commit 5eab51f7 authored by tkent's avatar tkent Committed by Commit bot

Revert of ChannelMojo: Let MessagePipeReader wait "peer closed" signal as...

Revert of ChannelMojo: Let MessagePipeReader wait "peer closed" signal as well. (patchset #2 id:20001 of https://codereview.chromium.org/1023043002/)

Reason for revert:
speculative revert for "Too many open files" on various Mac bots.
e.g. http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.9/builds/17511/steps/webkit_tests/logs/stdio

Original issue's description:
> ChannelMojo: Let MessagePipeReader wait "peer closed" signal as well.
>
> This CL adds MOJO_SIGNAL_PEER_CLOSED for the MessagePipeReader's
> waiting bits. Without this, PRECONDITION_FAILED error can be notified
> at the end of the channel lifetime, and the browser process misinterprets
> it as a renderer crash, which results sadface screen.
>
> This rarely happens and is reproduced only with some underpowered CPU
> with excessive pressure. So we cannot have any reliable test.
>
> BUG=466814
> R=viettrungluu@chromium.org
>
> Committed: https://crrev.com/29d88220e88d21deaf6856b7ded300fa06ab94d3
> Cr-Commit-Position: refs/heads/master@{#322094}

TBR=viettrungluu@chromium.org,morrita@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=466814

Review URL: https://codereview.chromium.org/1035633002

Cr-Commit-Position: refs/heads/master@{#322112}
parent 55116bef
......@@ -161,9 +161,8 @@ void MessagePipeReader::ReadMessagesThenWait() {
// If can fail with |MOJO_RESULT_ALREADY_EXISTS| otherwise.
// Also, we don't use MOJO_HANDLE_SIGNAL_WRITABLE here, expecting buffer in
// MessagePipe.
MojoResult result = async_waiter_->Wait(
pipe_.get().value(),
MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED);
MojoResult result =
async_waiter_->Wait(pipe_.get().value(), MOJO_HANDLE_SIGNAL_READABLE);
// If the result is |MOJO_RESULT_ALREADY_EXISTS|, there could be messages
// that have been arrived after the last |ReadAvailableMessages()|.
// We have to consume then and retry in that case.
......@@ -181,9 +180,13 @@ void MessagePipeReader::ReadMessagesThenWait() {
void MessagePipeReader::PipeIsReady(MojoResult wait_result) {
if (wait_result != MOJO_RESULT_OK) {
CHECK_NE(wait_result, MOJO_RESULT_ABORTED);
LOG(ERROR) << "Pipe got error from the waiter. Closing: " << wait_result;
OnPipeError(wait_result);
if (wait_result != MOJO_RESULT_ABORTED) {
// FAILED_PRECONDITION happens every time the peer is dead so
// it isn't worth polluting the log message.
LOG_IF(WARNING, wait_result != MOJO_RESULT_FAILED_PRECONDITION)
<< "Pipe got error from the waiter. Closing: " << wait_result;
OnPipeError(wait_result);
}
Close();
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment