Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-12517

Beeline's use of failed connection(s) causes failures and leaks.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.3.0, 2.0.0
    • Hive
    • None

    Description

      Beeline adds a bad connection(s) to the connection list and makes it the current connection, so any subsequent queries will attempt to use this bad connection and will fail. Even a "!close" would not work.
      1) all queries fail unless !go is used.
      2) !closeall cannot close the active connections either.
      3) !exit will exit while attempting to establish these inactive connections without closing the active connections. So this could hold up server side resources.

      beeline> !connect jdbc:hive2://localhost:10000 hive1 hive1
      scan complete in 8ms
      Connecting to jdbc:hive2://localhost:10000
      Connected to: Apache Hive (version 2.0.0-SNAPSHOT)
      Driver: Hive JDBC (version 1.1.0-cdh5.7.0-SNAPSHOT)
      Transaction isolation: TRANSACTION_REPEATABLE_READ
      0: jdbc:hive2://localhost:10000> !connect jdbc:hive2://localhost:10000 hive1 hive1
      Connecting to jdbc:hive2://localhost:10000
      Connected to: Apache Hive (version 2.0.0-SNAPSHOT)
      Driver: Hive JDBC (version 1.1.0-cdh5.7.0-SNAPSHOT)
      Transaction isolation: TRANSACTION_REPEATABLE_READ
      1: jdbc:hive2://localhost:10000> !connect jdbc:hive2://localhost:10000 hive1 hive1
      Connecting to jdbc:hive2://localhost:10000
      Connected to: Apache Hive (version 2.0.0-SNAPSHOT)
      Driver: Hive JDBC (version 1.1.0-cdh5.7.0-SNAPSHOT)
      Transaction isolation: TRANSACTION_REPEATABLE_READ
      2: jdbc:hive2://localhost:10000> !tables
      +------------+--------------+---------------------+-------------+----------+--+
      | TABLE_CAT  | TABLE_SCHEM  |     TABLE_NAME      | TABLE_TYPE  | REMARKS  |
      +------------+--------------+---------------------+-------------+----------+--+
      |            | default      | char_nested_1       | TABLE       | NULL     |
      |            | default      | src                 | TABLE       | NULL     |
      |            | default      | char_nested_struct  | TABLE       | NULL     |
      |            | default      | src_thrift          | TABLE       | NULL     |
      |            | default      | x                   | TABLE       | NULL     |
      +------------+--------------+---------------------+-------------+----------+--+
      2: jdbc:hive2://localhost:10000> !list
      3 active connections:
       #0  open     jdbc:hive2://localhost:10000
       #1  open     jdbc:hive2://localhost:10000
       #2  open     jdbc:hive2://localhost:10000
      2: jdbc:hive2://localhost:10000> !connect jdbc:hive2://localhost:11000 hive1 hive1
      Connecting to jdbc:hive2://localhost:11000
      Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:11000: java.net.ConnectException: Connection refused (state=08S01,code=0)
      3: jdbc:hive2://localhost:11000 (closed)> !tables
      Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:11000: java.net.ConnectException: Connection refused (state=08S01,code=0)
      3: jdbc:hive2://localhost:11000 (closed)> !list
      4 active connections:
       #0  open     jdbc:hive2://localhost:10000
       #1  open     jdbc:hive2://localhost:10000
       #2  open     jdbc:hive2://localhost:10000
       #3  closed   jdbc:hive2://localhost:11000
      3: jdbc:hive2://localhost:11000 (closed)> !close
      Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:11000: java.net.ConnectException: Connection refused (state=08S01,code=0)
      3: jdbc:hive2://localhost:11000 (closed)> !closeall
      Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:11000: java.net.ConnectException: Connection refused (state=08S01,code=0)
      4: jdbc:hive2://localhost:11000 (closed)> !exit
      Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:11000: java.net.ConnectException: Connection refused (state=08S01,code=0)
      Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:11000: java.net.ConnectException: Connection refused (state=08S01,code=0)
      

      The workaround is to use !go to set the current connection to a "good" connection.

      Attachments

        1. HIVE-12517.patch
          0.6 kB
          Naveen Gangam

        Activity

          People

            ngangam Naveen Gangam
            ngangam Naveen Gangam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: