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

Remove dead code in RmAppImpl.RMAppRecoveredTransition

    Details

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

      Description

      The transition() method contains the following:

            // Last attempt is in final state, return ACCEPTED waiting for last
            // RMAppAttempt to send finished or failed event back.
            if (app.currentAttempt != null
                && (app.currentAttempt.getState() == RMAppAttemptState.KILLED
                    || app.currentAttempt.getState() == RMAppAttemptState.FINISHED
                    || (app.currentAttempt.getState() == RMAppAttemptState.FAILED
                        && app.getNumFailedAppAttempts() == app.maxAppAttempts))) {
              return RMAppState.ACCEPTED;
            }
      
            // YARN-1507 is saving the application state after the application is
            // accepted. So after YARN-1507, an app is saved meaning it is accepted.
            // Thus we return ACCECPTED state on recovery.
            return RMAppState.ACCEPTED;
      

      The if statement is fully redundant and can be eliminated.

        Attachments

        1. YARN-4421.001.patch
          2 kB
          Daniel Templeton

          Activity

            People

            • Assignee:
              templedf Daniel Templeton
              Reporter:
              templedf Daniel Templeton
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: