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

Incorrect precheck condition in RoundRobinPool#get()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None
    • Reviewed

    Description

      Here is related code:

          public R get() {
            if (super.size() < maxSize) {
              return null;
            }
            nextResource %= super.size();
      

      Since super.size() is involved in modulo operation after the check, it seems the check should compare against 0 instead of maxSize.

      Looks like a copy-paste error from put() method.

      Attachments

        1. HBASE-17431.master.002.patch
          0.9 kB
          Jan Hentschel
        2. HBASE-17431.master.001.patch
          0.9 kB
          Jan Hentschel

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yuzhihong@gmail.com Ted Yu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: