cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject git commit: Error when using hsha w/ unlimited rpc_max_threads
Date Fri, 24 Oct 2014 17:04:26 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 46f43cee7 -> 1b332bc1c


Error when using hsha w/ unlimited rpc_max_threads

Patch by Tyler Hobbs; reviewed by Mike Adamson for CASSANDRA-8116


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

Branch: refs/heads/cassandra-2.0
Commit: 1b332bc1c02786623e2baf773e9f46af9c04f21f
Parents: 46f43ce
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Fri Oct 24 12:02:16 2014 -0500
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Fri Oct 24 12:02:16 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                  | 2 ++
 src/java/org/apache/cassandra/config/DatabaseDescriptor.java | 7 +++++++
 src/java/org/apache/cassandra/thrift/ThriftServer.java       | 6 +++---
 3 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1b332bc1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6c2be8c..11f6517 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 2.0.12:
  * Pig: Remove errant LIMIT clause in CqlNativeStorage (CASSANDRA-8166)
+ * Throw ConfigurationException when hsha is used with the default
+   rpc_max_threads setting of 'unlimited' (CASSANDRA-8116)
 
 
 2.0.11:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1b332bc1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 209d6c9..92ef79a 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -27,6 +27,7 @@ import java.util.*;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.primitives.Longs;
+import org.apache.cassandra.thrift.ThriftServer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -333,6 +334,12 @@ public class DatabaseDescriptor
         if (conf.native_transport_max_frame_size_in_mb <= 0)
             throw new ConfigurationException("native_transport_max_frame_size_in_mb must
be positive");
 
+        // fail early instead of OOMing (see CASSANDRA-8116)
+        if (ThriftServer.HSHA.equals(conf.rpc_server_type) && conf.rpc_max_threads
== Integer.MAX_VALUE)
+            throw new ConfigurationException("The hsha rpc_server_type is not compatible
with an rpc_max_threads " +
+                                             "setting of 'unlimited'.  Please see the comments
in cassandra.yaml " +
+                                             "for rpc_server_type and rpc_max_threads.");
+
         /* end point snitch */
         if (conf.endpoint_snitch == null)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1b332bc1/src/java/org/apache/cassandra/thrift/ThriftServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/ThriftServer.java b/src/java/org/apache/cassandra/thrift/ThriftServer.java
index dbd3824..7ca7261 100644
--- a/src/java/org/apache/cassandra/thrift/ThriftServer.java
+++ b/src/java/org/apache/cassandra/thrift/ThriftServer.java
@@ -34,9 +34,9 @@ import org.apache.thrift.transport.TTransportFactory;
 public class ThriftServer implements CassandraDaemon.Server
 {
     private static Logger logger = LoggerFactory.getLogger(ThriftServer.class);
-    protected final static String SYNC = "sync";
-    protected final static String ASYNC = "async";
-    protected final static String HSHA = "hsha";
+    public final static String SYNC = "sync";
+    public final static String ASYNC = "async";
+    public final static String HSHA = "hsha";
 
     protected final InetAddress address;
     protected final int port;


Mime
View raw message