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

Forgetting to close operation cuts off any more HiveServer2 output

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 3.0.0
    • Fix Version/s: 4.0.0
    • Component/s: None
    • Labels:
      None

      Description

      We had a custom client that did not handle closing the operations, until the end of the session. it is a mistake in the client, but it reveals kind of a vulnerability in HiveServer2

      This happens if you have a session with (1) HiveCommandOperation and (2) SQLOperation and don't close them right after. For example a session that does the operations (set a=b; select * from foobar; ).

      When SQLOperation runs , it set SessionState.out and err to be System.out and System.err . Ref: SQLOperation#setupSessionIO

      Then the client closes the session, or disconnects which triggers closeSession() on the Thrift side. In this case, the closeSession closes all the operations, starting with HiveCommandOperation. This closes all the streams, which is System.out and System.err as set by SQLOperation earlier. Ref: HiveCommandOperation#tearDownSessionIO

      After this, no more HiveServer2 output appears as System.out and System.err are closed.

        Attachments

        1. HIVE-21033.patch
          14 kB
          Szehon Ho
        2. HIVE-21033.5.patch
          21 kB
          Szehon Ho
        3. HIVE-21033.4.patch
          22 kB
          Szehon Ho
        4. HIVE-21033.3.patch
          21 kB
          Szehon Ho
        5. HIVE-21033.2.patch
          18 kB
          Szehon Ho

          Issue Links

            Activity

              People

              • Assignee:
                szehon Szehon Ho
                Reporter:
                szehon Szehon Ho
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: