cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject [1/6] cassandra git commit: IOException (No such file or directory) closing MessagingService's server socket (locally)
Date Wed, 08 Mar 2017 12:58:34 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 71c1f9866 -> 1ae841951
  refs/heads/cassandra-3.11 2b62cb997 -> 1248d3620
  refs/heads/trunk 66e2c1b90 -> 7755a324e


IOException (No such file or directory) closing MessagingService's server socket (locally)

patch by Robert Stupp; reviewed by Michael Kjellman for CASSANDRA-12513


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1ae84195
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1ae84195
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1ae84195

Branch: refs/heads/cassandra-3.0
Commit: 1ae84195116eb346522c59042df8a2156a3f19f0
Parents: 71c1f98
Author: Robert Stupp <snazy@snazy.de>
Authored: Wed Mar 8 13:55:45 2017 +0100
Committer: Robert Stupp <snazy@snazy.de>
Committed: Wed Mar 8 13:55:45 2017 +0100

----------------------------------------------------------------------
 .../apache/cassandra/net/MessagingService.java  | 23 +++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ae84195/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index c784b15..31ea09e 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -812,7 +812,7 @@ public final class MessagingService implements MessagingServiceMBean
                 catch (IOException e)
                 {
                     // see https://issues.apache.org/jira/browse/CASSANDRA-10545
-                    handleIOException(e);
+                    handleIOExceptionOnClose(e);
                 }
         }
         catch (IOException e)
@@ -1102,7 +1102,8 @@ public final class MessagingService implements MessagingServiceMBean
             catch (IOException e)
             {
                 // see https://issues.apache.org/jira/browse/CASSANDRA-8220
-                handleIOException(e);
+                // see https://issues.apache.org/jira/browse/CASSANDRA-12513
+                handleIOExceptionOnClose(e);
             }
             for (Closeable connection : connections)
             {
@@ -1116,12 +1117,22 @@ public final class MessagingService implements MessagingServiceMBean
         }
     }
 
-    private static void handleIOException(IOException e) throws IOException
+    private static void handleIOExceptionOnClose(IOException e) throws IOException
     {
         // dirty hack for clean shutdown on OSX w/ Java >= 1.8.0_20
-        // see https://bugs.openjdk.java.net/browse/JDK-8050499
-        if (!"Unknown error: 316".equals(e.getMessage()) || !"Mac OS X".equals(System.getProperty("os.name")))
-            throw e;
+        // see https://bugs.openjdk.java.net/browse/JDK-8050499;
+        // also CASSANDRA-12513
+        if ("Mac OS X".equals(System.getProperty("os.name")))
+        {
+            switch (e.getMessage())
+            {
+                case "Unknown error: 316":
+                case "No such file or directory":
+                    return;
+            }
+        }
+
+        throw e;
     }
 
     public Map<String, Integer> getLargeMessagePendingTasks()


Mime
View raw message