You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Peter Bacsko (Jira)" <ji...@apache.org> on 2021/01/25 12:59:00 UTC

[jira] [Created] (YARN-10593) Fix incorrect string comparison in GpuDiscoverer

Peter Bacsko created YARN-10593:
-----------------------------------

             Summary: Fix incorrect string comparison in GpuDiscoverer
                 Key: YARN-10593
                 URL: https://issues.apache.org/jira/browse/YARN-10593
             Project: Hadoop YARN
          Issue Type: Bug
          Components: resourcemanager
            Reporter: Peter Bacsko
            Assignee: Peter Bacsko


The following comparison in {{GpuDiscoverer}} is invalid:


{noformat}
       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);
      }{noformat}
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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org