You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/27 04:09:56 UTC

[GitHub] [flink] tillrohrmann commented on a change in pull request #12315: [FLINK-17917][yarn] Ignore the external resource with a value of 0 in…

tillrohrmann commented on a change in pull request #12315:
URL: https://github.com/apache/flink/pull/12315#discussion_r429966710



##########
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:
       I think the proper solution is to enforce this invariant in the `InternalContainerResource` constructor (filtering out entries with a value of `0` or to adapt the `equals` method to not check entries with a value of `0`). Otherwise we might run into the situation that sometime in the future when the user can specify the GPU constraints on an operator and he sets it to `0` that the resources won't match.




----------------------------------------------------------------
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:
users@infra.apache.org