Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-1410

ZooSession.connect barely adheres to timeout

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: client, fate
    • Labels:
      None

      Description

      ZooSession.connect, which is used by ZooKeeperInstance, takes an argument for a timeout, and utilizes it to an extent-

      if (System.currentTimeMillis() - startTime > 2 * timeout)

      However, this is only used after a check which uses hardcoded values. Currently, this is set to 10*1000ms. More specifically, it uses this value and checks every 100ms to see if it's connected. So if you have a tiny timeout, there are 2 issues:

      1. Your timeout is only useful in 10 second increments, rounded up
      1. You get a nice helpful error message that hides that real lengths of attempt

      I think the block of code should be changed to just try to connect for the user specified timeout length, working in the same 100ms increments. This allows more granularity in the handling of the user specified values (and I think it also simplifies the code). This will also make the timeout message more accurate.

        Attachments

        1. ACCUMULO-1410.patch
          2 kB
          John Vines

          Activity

            People

            • Assignee:
              vines John Vines
              Reporter:
              vines John Vines
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: