Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-7602

TestFromClientSide.testPoolBehavior is incorrect

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.94.5, 0.95.0
    • Component/s: None
    • Labels:
      None

      Description

      The writer of this test misunderstood ThreadPoolExecutor.

      The test adds Threads as tasks to a ThreadPoolExecutor and then calls join on the Thread objects. But these are not the running threads, it work by pure accident, because Thread happens to implement Runnable.

      pool.submit(threads.get(0));
      ...
      threads.get(0).join();
      

      The join will always return immediately, because the thread never ran.
      This should instead synchronize on the Future returned from submit instead, otherwise there is no guarantee that the threads in the pool actually finished.

        Attachments

        1. 7602-0.94.txt
          2 kB
          Lars Hofhansl
        2. 7602-0.96.txt
          2 kB
          Lars Hofhansl

          Activity

            People

            • Assignee:
              larsh Lars Hofhansl
              Reporter:
              larsh Lars Hofhansl

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment