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

Misuse core/maxPoolSize of LinkedBlockingQueue in ThreadPoolExecutor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • Client, Replication, Thrift
    • None
    • Reviewed
    • Hide
      The core pool size and max pool size of ThreadPoolExecutor should be the same when LinkedBlockingQueue is used. Thus the configurations hbase.hconnection.threads.max, hbase.hconnection.meta.lookup.threads.max, hbase.region.replica.replication.threads.max and hbase.multihconnection.threads.max are used as the number of the core threads, and the related configurations *.thread.core are not used any more.
      Show
      The core pool size and max pool size of ThreadPoolExecutor should be the same when LinkedBlockingQueue is used. Thus the configurations hbase.hconnection.threads.max, hbase.hconnection.meta.lookup.threads.max, hbase.region.replica.replication.threads.max and hbase.multihconnection.threads.max are used as the number of the core threads, and the related configurations *.thread.core are not used any more.

    Description

      LinkedBlockingQueue is usually used in ThreadPoolExecutor. It allows the thread pool not to be blocked if the number of running threads in the pool is less than the max pool size and the queue is not full.
      But when the core pool size of ThreadPoolExecutor is different from the max pool size, the things don't go as expected. When the number of running threads is the same with the core size, more requests of executions are added into the LinkedBlockingQueue. And the requests can be executed again only when LinkedBlockingQueue is full or some of running threads are finished.
      Thus it is better to use the same value for the core and max pool size when the LinkedBlockingQueue is used.

      Attachments

        1. HBASE-15784.patch
          9 kB
          Jingcheng Du
        2. HBASE-15784-v2.patch
          14 kB
          Jingcheng Du

        Issue Links

          Activity

            People

              jingcheng.du@intel.com Jingcheng Du
              jingcheng.du@intel.com Jingcheng Du
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: