Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-2945

FSLeafQueue#assignContainer - document the reason for using both write and read locks

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      After YARN-2910, assignContainer hold WriteLock while sorting and ReadLock while referencing runnableApps. This can cause interrupted assignment of containers regardless of the policy.

          writeLock.lock();
          try {
            Collections.sort(runnableApps, comparator);
          } finally {
            writeLock.unlock();
          }
          readLock.lock();
          try {
            for (FSAppAttempt sched : runnableApps) {
              if (SchedulerAppUtils.isBlacklisted(sched, node, LOG)) {
                continue;
              }
      
              assigned = sched.assignContainer(node);
              if (!assigned.equals(Resources.none())) {
                break;
              }
             }
          } finally {
            readLock.unlock();
          }
      

        Attachments

        1. YARN-2945.001.patch
          1 kB
          Tsuyoshi Ozawa
        2. YARN-2945.002.patch
          1 kB
          Tsuyoshi Ozawa

          Activity

            People

            • Assignee:
              ozawa Tsuyoshi Ozawa
              Reporter:
              ozawa Tsuyoshi Ozawa
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: