Browse Source

[impala] Separate server timeouts

Abraham Elmahrek 11 năm trước cách đây
mục cha
commit
d45bd82

+ 5 - 1
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -37,6 +37,8 @@ from beeswax.models import Session, HiveServerQueryHandle, HiveServerQueryHistor
 from beeswax.server.dbms import Table, NoSuchObjectException, DataTable,\
                                 QueryServerException
 
+from impala import conf as impala_conf
+
 
 LOG = logging.getLogger(__name__)
 
@@ -307,8 +309,10 @@ class HiveServerClient:
 
     if self.query_server['server_name'] == 'impala':
       ssl_enabled = False
+      timeout = impala_conf.SERVER_CONN_TIMEOUT.get()
     else:
       ssl_enabled = beeswax_conf.SSL.ENABLED.get()
+      timeout = beeswax_conf.SERVER_CONN_TIMEOUT.get()
 
     self._client = thrift_util.get_client(TCLIService.Client,
                                           query_server['server_host'],
@@ -318,7 +322,7 @@ class HiveServerClient:
                                           use_sasl=use_sasl,
                                           mechanism=mechanism,
                                           username=user.username,
-                                          timeout_seconds=beeswax_conf.SERVER_CONN_TIMEOUT.get(),
+                                          timeout_seconds=timeout,
                                           use_ssl=ssl_enabled,
                                           ca_certs=beeswax_conf.SSL.CACERTS.get(),
                                           keyfile=beeswax_conf.SSL.KEY.get(),

+ 6 - 0
apps/impala/src/impala/conf.py

@@ -55,6 +55,12 @@ QUERYCACHE_ROWS=Config(
   type=int,
   default=50000)
 
+SERVER_CONN_TIMEOUT = Config(
+  key='server_conn_timeout',
+  default=120,
+  type=int,
+  help=_t('Timeout in seconds for Thrift calls.'))
+
 CLOSE_QUERIES = Config(
   key="close_queries",
   help=_t("Hue will try to close the Impala query when the user leaves the editor page. "

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -702,6 +702,9 @@
   # Set to 0 for disabling the option and backward compatibility.
   ## querycache_rows=50000
 
+  # Timeout in seconds for thrift calls
+  ## server_conn_timeout=120
+
   # Hue will try to close the Impala query when the user leaves the editor page.
   # This will free all the query resources in Impala, but also make its results inaccessible.
   ## close_queries=true

+ 3 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -743,6 +743,9 @@
   # Set to 0 for disabling the option and backward compatibility.
   ## querycache_rows=50000
 
+  # Timeout in seconds for thrift calls
+  ## server_conn_timeout=120
+
   # Hue will try to close the Impala query when the user leaves the editor page.
   # This will free all the query resources in Impala, but also make its results inaccessible.
   ## close_queries=true