Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4228

Impala JDBC: Concurrent connections - ResultSet#next() locks execution when no more records in ResultSet

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • Impala 2.3.0
    • None
    • Perf Investigation
    • None

    Description

      While running performance tests I'm noticing that quite often execution of all threads are blocked around invocation of ResultSet#next() when there are no more records in result set and ResultSet#next() will eventually return false.
      Particularly in my test I'm periodically starting 10 connections with each connection to run the same query 10 times - i.e. 10*10=100 queries for every run.
      The query is 'select * from <some_table> limit 10'
      The issue doesn't take place in single-threaded mode, only with multiple connections working simultaneously.
      See related log lines generated by the attached reproduction code:
      16:33:24.781 1304: BEFORE rs.next()
      16:33:24.781 1304: AFTER rs.next() next = true
      16:33:24.781 1304: BEFORE rs.next()
      16:33:24.781 1304: AFTER rs.next() next = true
      16:33:24.781 1304: BEFORE rs.next() //this is the last rs.next() for cycle no. 1304
      //nothing here for 25 second, looks like locking issue, notice that several threads are calling ResultSet.next for the last time
      16:33:50.049 1312: AFTER rs.next() next = false
      16:33:50.049 1309: AFTER rs.next() next = false
      16:33:50.049 1309: AFTER handling ResultSet
      16:33:50.049 1307: AFTER rs.next() next = false
      16:33:50.049 1308: AFTER rs.next() next = false
      16:33:50.049 1314: BEFORE stmt.executeQuery
      16:33:50.049 1304: AFTER rs.next() next = false //rs.next() for cycle no. 1304 returned in 25 seconds
      16:33:50.049 1313: AFTER rs.next() next = false
      16:33:50.049 1313: AFTER handling ResultSet
      16:33:50.049 1304: AFTER handling ResultSet

      Attachments

        1. IssueReproductionMultiThreaded.java
          5 kB
          Valeriy Cherepanov

        Activity

          People

            Unassigned Unassigned
            vcherepanov_impala_20b9 Valeriy Cherepanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: