gaoyunhaii commented on a change in pull request #8704: [FLINK-12812][runtime] Set resource profiles for task slots URL: https://github.com/apache/flink/pull/8704#discussion_r294166391
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java ########## @@ -585,7 +585,8 @@ private TaskManagerSlot createAndRegisterTaskManagerSlot(SlotID slotId, Resource @Nullable private PendingTaskManagerSlot findExactlyMatchingPendingTaskManagerSlot(ResourceProfile resourceProfile) { for (PendingTaskManagerSlot pendingTaskManagerSlot : pendingSlots.values()) { - if (pendingTaskManagerSlot.getResourceProfile().equals(resourceProfile)) { + // there might be slight error between slot resource profiles calculated by RM / TM + if (pendingTaskManagerSlot.getResourceProfile().approximate(resourceProfile)) { Review comment: I'm a little worry that the approximation may not be tolerant in TM side. For example, if the network memory of the available slot is just 1MB less than the request slot, it is very likely to cause the InsufficientBufferException in the TM side. I'm not sure why we can't make the request exactly the same with the available slot ? Or at least we must ensure pendingTaskManagerSlot.getResourceProfile().isMatching(resourceProfile) is also true. ---------------------------------------------------------------- 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 With regards, Apache Git Services