Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2285

phoenix.query.timeoutMs doesn't allow callers to set the timeout to less than 1 second

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.5.2
    • 4.6.0, 4.5.3
    • None
    • None

    Description

      When creating a Phoenix JDBC connection I have a use case where I want to override the default value of phoenix.query.timeoutMs to a value of 200 ms.

      Currently if you set phoenix.query.timeoutMs to less than 1000 ms, the timeout gets rounded up to 1000ms. This is because in PhoenixStatement.getDefaultQueryTimeout() we convert the value of phoenix.query.timeoutMs to seconds in order to be compliant with JDBC. In BaseResultIterators we then convert it back to millis. As a result of the conversion we loose the millisecond fidelity.

      A possible solution is to store the timeout value stored on the PhoenixStatement in both seconds and milliseconds. Then, in BaseResultIterators when we read the value from the statement we can check if the value exists in millisecond fidelity and if so use that value. Otherwise we would use the value in second granularity and convert.

      This would allow Phoenix to remain JDBC compatible with second level granularity for setting query timeouts on statements, but allow millisecond granularity of timeouts by explicitly setting phoenix.query.timeoutMs on connection properties.

      Attachments

        1. PHOENIX-2285-v1.txt
          14 kB
          Jan Fernando
        2. PHOENIX-2285-v2.txt
          15 kB
          Jan Fernando

        Activity

          People

            jfernando_sfdc Jan Fernando
            jfernando_sfdc Jan Fernando
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: