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

Fix waitForMaximumCurrentTasks logic in AsyncProcess

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.2.1, 1.1.4, 2.0.0
    • None
    • None
    • None

    Description

      In current implementation of AsyncProcess#waitForMaximumCurrentTasks, we have below codes:

      while ((currentInProgress = this.tasksInProgress.get()) > max) {
            ...
            try {
              synchronized (this.tasksInProgress) {
                if (tasksInProgress.get() != oldInProgress) break;
                this.tasksInProgress.wait(100);
              }
            } catch (InterruptedException e) {
              throw new InterruptedIOException("#" + id + ", interrupted." +
                  " currentNumberOfTask=" + currentInProgress);
            }
      }
      

      Which will cause end of while loop if there's any task done inside one loop making taskInProgress.get() no longer equals to oldInProgress

      This is a regression issue caused by HBASE-11403 and only exists in branch-1/master branch, we could easily see the difference comparing to latest 0.98 code.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: