Title: [262099] trunk/Source/WebKit
Revision
262099
Author
[email protected]
Date
2020-05-23 09:21:11 -0700 (Sat, 23 May 2020)

Log Message

Error sending IPC message: Broken pipe
https://bugs.webkit.org/show_bug.cgi?id=206052

Reviewed by Adrian Perez de Castro.

The Connection implementation on *nix was not handling socket
shutdowns gracefully, this was leading to many IPC error messages
being printed. It looks like the "errors" were actually
application issues, trying to send messages during socket shutdown
sequences, rather than more serious message drop problems.

Unclear how to autotest this, but manual testing opening lots of tabs
definitely hits these codepaths.

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::readyReadHandler): Handle ECONNRESET by cleanly
closing the connection.
(IPC::Connection::sendOutputMessage): Ditto, also handle the
wrinkle that for "reasons", Linux can return EPIPE when it means
ECONNRESET.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (262098 => 262099)


--- trunk/Source/WebKit/ChangeLog	2020-05-23 14:57:15 UTC (rev 262098)
+++ trunk/Source/WebKit/ChangeLog	2020-05-23 16:21:11 UTC (rev 262099)
@@ -1,3 +1,26 @@
+2020-05-23  Charlie Turner  <[email protected]>
+
+        Error sending IPC message: Broken pipe
+        https://bugs.webkit.org/show_bug.cgi?id=206052
+
+        Reviewed by Adrian Perez de Castro.
+
+        The Connection implementation on *nix was not handling socket
+        shutdowns gracefully, this was leading to many IPC error messages
+        being printed. It looks like the "errors" were actually
+        application issues, trying to send messages during socket shutdown
+        sequences, rather than more serious message drop problems.
+
+        Unclear how to autotest this, but manual testing opening lots of tabs
+        definitely hits these codepaths.
+
+        * Platform/IPC/unix/ConnectionUnix.cpp:
+        (IPC::Connection::readyReadHandler): Handle ECONNRESET by cleanly
+        closing the connection.
+        (IPC::Connection::sendOutputMessage): Ditto, also handle the
+        wrinkle that for "reasons", Linux can return EPIPE when it means
+        ECONNRESET.
+
 2020-05-22  James Savage  <[email protected]>
 
         Create Swift overlay for WebKit framework

Modified: trunk/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp (262098 => 262099)


--- trunk/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp	2020-05-23 14:57:15 UTC (rev 262098)
+++ trunk/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp	2020-05-23 16:21:11 UTC (rev 262099)
@@ -322,6 +322,11 @@
             if (errno == EAGAIN || errno == EWOULDBLOCK)
                 return;
 
+            if (errno == ECONNRESET) {
+                connectionDidClose();
+                return;
+            }
+
             if (m_isConnected) {
                 WTFLogAlways("Error receiving IPC message on socket %d in process %d: %s", m_socketDescriptor, getpid(), strerror(errno));
                 connectionDidClose();
@@ -544,6 +549,17 @@
 #endif
         }
 
+#if OS(LINUX)
+        // Linux can return EPIPE instead of ECONNRESET
+        if (errno == EPIPE || errno == ECONNRESET)
+#else
+        if (errno == ECONNRESET)
+#endif
+        {
+            connectionDidClose();
+            return false;
+        }
+
         if (m_isConnected)
             WTFLogAlways("Error sending IPC message: %s", strerror(errno));
         return false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to