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

Prevent parallel purge in ObjectPool

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • None
    • Reviewed

    Description

      Parallel purge in ObjectPool is meaningless and will cause contention issue since ReferenceQueue#poll has synchronization (source code shown below)

          public Reference<? extends T> poll() {
              if (head == null)
                  return null;
              synchronized (lock) {
                  return reallyPoll();
              }
          }
      

      We observed threads blocking on the purge method while using offheap bucket cache, and we could easily reproduce this by testing the 100% cache hit case in bucket cache with enough reading threads.

      We propose to add a purgeLock and use tryLock to avoid parallel purge.

      Attachments

        1. e89l05465.st3.jstack
          666 kB
          Yu Li
        2. HBASE-18085.patch
          5 kB
          Yu Li
        3. HBASE-18085.patch
          6 kB
          Yu Li

        Activity

          People

            liyu Yu Li
            liyu Yu Li
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: