You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2016/01/12 18:52:00 UTC

cassandra git commit: cqlsh: Apply --connect-timeout to control conn

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 a6e5cdaef -> de946ae45


cqlsh: Apply --connect-timeout to control conn

Patch by Julien Blondeau; reviewed by Tyler Hobbs for CASSANDRA-10959


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

Branch: refs/heads/cassandra-2.2
Commit: de946ae45ad8af3718d4159e885e6700230d4818
Parents: a6e5cda
Author: Julien Blondeau <lo...@gmail.com>
Authored: Tue Jan 12 11:51:20 2016 -0600
Committer: Tyler Hobbs <ty...@gmail.com>
Committed: Tue Jan 12 11:51:20 2016 -0600

----------------------------------------------------------------------
 CHANGES.txt  | 2 ++
 bin/cqlsh.py | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/de946ae4/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 477a104..f895139 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.2.5
+ * (cqlsh) Also apply --connect-timeout to control connection
+   timeout (CASSANDRA-10959)
  * Histogram buckets exposed in jmx are sorted incorrectly (CASSANDRA-10975)
  * Enable GC logging by default (CASSANDRA-10140)
  * Optimize pending range computation (CASSANDRA-9258)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/de946ae4/bin/cqlsh.py
----------------------------------------------------------------------
diff --git a/bin/cqlsh.py b/bin/cqlsh.py
index c38bc2e..be2ad46 100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@ -141,7 +141,6 @@ from cassandra.cluster import Cluster
 from cassandra.metadata import (ColumnMetadata, KeyspaceMetadata,
                                 TableMetadata, protect_name, protect_names)
 from cassandra.policies import WhiteListRoundRobinPolicy
-from cassandra.protocol import ResultMessage
 from cassandra.query import SimpleStatement, ordered_dict_factory, TraceUnavailable
 
 # cqlsh should run correctly when run out of a Cassandra source tree,
@@ -683,6 +682,7 @@ class Shell(cmd.Cmd):
                                 auth_provider=self.auth_provider,
                                 ssl_options=sslhandling.ssl_settings(hostname, CONFIG_FILE) if ssl else None,
                                 load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]),
+                                control_connection_timeout=connect_timeout,
                                 connect_timeout=connect_timeout)
         self.owns_connection = not use_conn
         self.set_expanded_cql_version(cqlver)
@@ -1201,7 +1201,7 @@ class Shell(cmd.Cmd):
     def perform_simple_statement(self, statement):
         if not statement:
             return False, None
-        rows = None
+
         while True:
             try:
                 future = self.session.execute_async(statement, trace=self.tracing_enabled)
@@ -2047,6 +2047,7 @@ class Shell(cmd.Cmd):
                        auth_provider=auth_provider,
                        ssl_options=self.conn.ssl_options,
                        load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]),
+                       control_connection_timeout=self.conn.connect_timeout,
                        connect_timeout=self.conn.connect_timeout)
 
         if self.current_keyspace: