Details

    • Type: Sub-task
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: yarn
    • Labels:
      None
    • Flags:
      Patch

      Description

      FSStarvedApps is not thread safe, this may make one starve app is processed for two times continuously.

      For example, when app1 is fair share starved, it has been added to appsToProcess. After that, app1 is taken but appBeingProcessed is not yet update to app1. At the moment, app1 is starved by min share, so this app is added to appsToProcess again! Because appBeingProcessed is null and appsToProcess also have not this one. 

      void addStarvedApp(FSAppAttempt app) {
      if (!app.equals(appBeingProcessed) && !appsToProcess.contains(app)) {
      appsToProcess.add(app);
      }
      }
      
      FSAppAttempt take() throws InterruptedException {
        // Reset appBeingProcessed before the blocking call
        appBeingProcessed = null;
      
        // Blocking call to fetch the next starved application
        FSAppAttempt app = appsToProcess.take();
        appBeingProcessed = app;
        return app;
      }
      

       

        Attachments

        1. YARN-8655.patch
          5 kB
          Zhaohui Xin
        2. YARN-8655.002.patch
          5 kB
          Zhaohui Xin

          Issue Links

            Activity

              People

              • Assignee:
                uranus Zhaohui Xin
                Reporter:
                uranus Zhaohui Xin
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: