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

Exception message from ClientRMProxy#getRMAddress is misleading

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.3.0
    • Component/s: yarn
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In ClientRMProxy#getRMAddress in the else branch we have the following piece of code.

          } else {
            String message = "Unsupported protocol found when creating the proxy " +
                "connection to ResourceManager: " +
                ((protocol != null) ? protocol.getClass().getName() : "null");
            LOG.error(message);
            throw new IllegalStateException(message);
          }
      

      This is wrong, because the protocol variable is of type "Class<?>", so Class.getClass() will be always Object. It should be protocol.getName().

      An example of the error message if RMProxy is misused, and this exception is thrown:

      java.lang.IllegalStateException: Unsupported protocol found when creating the proxy connection to ResourceManager: java.lang.Class
      	at org.apache.hadoop.yarn.client.ClientRMProxy.getRMAddress(ClientRMProxy.java:109)
      	at org.apache.hadoop.yarn.client.RMProxy.newProxyInstance(RMProxy.java:133)
              ...
      

      where obviously not a Object.class was provided to this function as protocol parameter.

        Attachments

        1. YARN-10081.001.patch
          0.9 kB
          Ravuri Sushma sree

          Activity

            People

            • Assignee:
              Sushma_28 Ravuri Sushma sree
              Reporter:
              adam.antal Adam Antal
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: