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

The message in IllegalArgumentException gave wrong information in NMTokenSecretManagerInRM.java and RMContainerTokenSecretManager.java

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • resourcemanager
    • None

    Description

      The message in IllegalArgumentException gave wrong information in NMTokenSecretManagerInRM.java and RMContainerTokenSecretManager.java.
      We saw this error message:

      Error starting ResourceManager
      java.lang.IllegalArgumentException: yarn.resourcemanager.nm-tokens.master-key-rolling-interval-secs should be more than 2 X yarn.nm.liveness-monitor.expiry-interval-ms
      

      After I checked the source code, I find this error message misleading.
      The following is code from NMTokenSecretManagerInRM.java

          rollingInterval = this.conf.getLong(        YarnConfiguration.RM_NMTOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS,    YarnConfiguration.DEFAULT_RM_NMTOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS)  * 1000;
          this.activationDelay =        (long) (conf.getLong(YarnConfiguration.RM_NM_EXPIRY_INTERVAL_MS,
                  YarnConfiguration.DEFAULT_RM_NM_EXPIRY_INTERVAL_MS) * 1.5);
          LOG.info("NMTokenKeyRollingInterval: " + this.rollingInterval
              + "ms and NMTokenKeyActivationDelay: " + this.activationDelay
              + "ms");
          if (rollingInterval <= activationDelay * 2) {
            throw new IllegalArgumentException(         YarnConfiguration.RM_NMTOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS              + " should be more than 2 X "
                    + YarnConfiguration.RM_NM_EXPIRY_INTERVAL_MS);
          }
      

      It should be 3 X not 2 X.
      Same error also happened in RMContainerTokenSecretManager.java.

         this.rollingInterval = conf.getLong(   YarnConfiguration.RM_CONTAINER_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS,       YarnConfiguration.DEFAULT_RM_CONTAINER_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS) * 1000;
          this.activationDelay =
              (long) (conf.getLong(YarnConfiguration.RM_NM_EXPIRY_INTERVAL_MS,
                  YarnConfiguration.DEFAULT_RM_NM_EXPIRY_INTERVAL_MS) * 1.5);
          LOG.info("ContainerTokenKeyRollingInterval: " + this.rollingInterval
              + "ms and ContainerTokenKeyActivationDelay: " + this.activationDelay
              + "ms");
          if (rollingInterval <= activationDelay * 2) {
            throw new IllegalArgumentException(      YarnConfiguration.RM_CONTAINER_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS              + " should be more than 2 X "            +YarnConfiguration.RM_CONTAINER_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS);
          }
      

      Attachments

        1. YARN-3106.000.patch
          2 kB
          Zhihai Xu

        Issue Links

          Activity

            People

              zxu Zhihai Xu
              zxu Zhihai Xu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: