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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.7.0
    • None
    • None
    • 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.002.patch
          1 kB
          Tsuyoshi Ozawa
        2. YARN-2945.001.patch
          1 kB
          Tsuyoshi Ozawa

        Activity

          People

            ozawa Tsuyoshi Ozawa
            ozawa Tsuyoshi Ozawa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: