KarmaGYZ commented on a change in pull request #12315: URL: https://github.com/apache/flink/pull/12315#discussion_r430118921
########## File path: flink-yarn/src/main/java/org/apache/flink/yarn/ResourceInformationReflector.java ########## @@ -151,7 +151,9 @@ void setResourceInformationUnSafe(Object resource, String resourceName, long amo for (int i = 2; i < externalResourcesInfo.length; i++) { final String name = (String) resourceInformationGetNameMethod.invoke(externalResourcesInfo[i]); final long value = (long) resourceInformationGetValueMethod.invoke(externalResourcesInfo[i]); - externalResources.put(name, value); + if (value > 0) { + externalResources.put(name, value); + } Review comment: Yes, you are right. ########## File path: flink-yarn/src/main/java/org/apache/flink/yarn/ResourceInformationReflector.java ########## @@ -151,7 +151,9 @@ void setResourceInformationUnSafe(Object resource, String resourceName, long amo for (int i = 2; i < externalResourcesInfo.length; i++) { final String name = (String) resourceInformationGetNameMethod.invoke(externalResourcesInfo[i]); final long value = (long) resourceInformationGetValueMethod.invoke(externalResourcesInfo[i]); - externalResources.put(name, value); + if (value > 0) { + externalResources.put(name, value); + } Review comment: Yes, you are right. I think filtering out entries with a value of 0 would be good enough. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org