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

Fix incorrect string comparison in GpuDiscoverer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.4.0
    • resourcemanager
    • None
    • Reviewed

    Description

      The following comparison in GpuDiscoverer is invalid:

             binaryPath = configuredBinaryFile;
            // If path exists but file name is incorrect don't execute the file
            String fileName = binaryPath.getName();
            if (DEFAULT_BINARY_NAME.equals(fileName)) {  <--- inverse condition needed
              String msg = String.format("Please check the configuration value of"
                   +" %s. It should point to an %s binary.",
                   YarnConfiguration.NM_GPU_PATH_TO_EXEC,
                   DEFAULT_BINARY_NAME);
              throwIfNecessary(new YarnException(msg), config);
              LOG.warn(msg);
            }

      Obviously it should be other way around - we should log a warning or throw an exception if the file names differ, not when they're equal.

      Consider adding a unit test for this.

      Attachments

        1. YARN-10593-001.patch
          4 kB
          Peter Bacsko

        Activity

          People

            pbacsko Peter Bacsko
            pbacsko Peter Bacsko
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: