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

Exception message from ClientRMProxy#getRMAddress is misleading

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.3.0
    • 3.3.0
    • yarn
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: