cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject [2/3] cassandra git commit: JDK bug prevents clean shutdown on OSX with Java 1.8.0_20
Date Sat, 18 Jul 2015 12:29:02 GMT
JDK bug prevents clean shutdown on OSX with Java 1.8.0_20

patch by Robert Stupp; reviewed by Aleksey Yeschenko for CASSANDRA-8220


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

Branch: refs/heads/trunk
Commit: 506068b181075281f160fde5fd7ffecf45177b2d
Parents: 437bb9d
Author: Robert Stupp <snazy@snazy.de>
Authored: Sat Jul 18 14:01:39 2015 +0200
Committer: Robert Stupp <snazy@snazy.de>
Committed: Sat Jul 18 14:07:28 2015 +0200

----------------------------------------------------------------------
 .../org/apache/cassandra/net/MessagingService.java | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/506068b1/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 83bc337..dec7550 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -934,8 +934,21 @@ public final class MessagingService implements MessagingServiceMBean
         void close() throws IOException
         {
             logger.debug("Closing accept() thread");
-            server.close();
-            for (Closeable connection : connections) 
+
+            try
+            {
+                server.close();
+            }
+            catch (IOException e)
+            {
+                // dirty hack for clean shutdown on OSX w/ Java >= 1.8.0_20
+                // see https://issues.apache.org/jira/browse/CASSANDRA-8220
+                // 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;
+            }
+
+            for (Closeable connection : connections)
             {
                 connection.close();
             }


Mime
View raw message