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

FairScheduler: potential livelock due to maxAMShare limitation and container reservation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: fairscheduler
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      FairScheduler: potential livelock due to maxAMShare limitation and container reservation.
      If a node is reserved by an application, all the other applications don't have any chance to assign a new container on this node, unless the application which reserves the node assigns a new container on this node or releases the reserved container on this node.
      The problem is if an application tries to call assignReservedContainer and fail to get a new container due to maxAMShare limitation, it will block all other applications to use the nodes it reserves. If all other running applications can't release their AM containers due to being blocked by these reserved containers. A livelock situation can happen.
      The following is the code at FSAppAttempt#assignContainer which can cause this potential livelock.

          // Check the AM resource usage for the leaf queue
          if (!isAmRunning() && !getUnmanagedAM()) {
            List<ResourceRequest> ask = appSchedulingInfo.getAllResourceRequests();
            if (ask.isEmpty() || !getQueue().canRunAppAM(
                ask.get(0).getCapability())) {
              if (LOG.isDebugEnabled()) {
                LOG.debug("Skipping allocation because maxAMShare limit would " +
                    "be exceeded");
              }
              return Resources.none();
            }
          }
      

      To fix this issue, we can unreserve the node if we can't allocate the AM container on the node due to Max AM share limitation and the node is reserved by the application.

        Attachments

        1. YARN-3655.000.patch
          1 kB
          zhihai xu
        2. YARN-3655.001.patch
          9 kB
          zhihai xu
        3. YARN-3655.002.patch
          16 kB
          zhihai xu
        4. YARN-3655.003.patch
          28 kB
          zhihai xu
        5. YARN-3655.004.patch
          27 kB
          zhihai xu

          Issue Links

            Activity

              People

              • Assignee:
                zxu zhihai xu
                Reporter:
                zxu zhihai xu
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: