xintongsong commented on a change in pull request #10608: 
[FLINK-15300][Runtime] Fix sanity check to not fail if shuffle memory fraction 
is out of min/max range
URL: https://github.com/apache/flink/pull/10608#discussion_r359130653
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/TaskExecutorResourceUtils.java
 ##########
 @@ -551,10 +551,16 @@ private static void sanityCheckShuffleMemory(final 
Configuration config, final M
                                        + 
shuffleRangeFraction.maxSize.toString() + "].");
                        }
                        if (isShuffleMemoryFractionExplicitlyConfigured(config) 
&&
-                               
!derivedShuffleMemorySize.equals(totalFlinkMemorySize.multiply(shuffleRangeFraction.fraction)))
 {
-                               throw new 
IllegalConfigurationException("Derived Shuffle Memory size("
-                                       + derivedShuffleMemorySize.toString() + 
") does not match configured Shuffle Memory fraction ("
-                                       + shuffleRangeFraction.fraction + ").");
+                               
!derivedShuffleMemorySize.equals(totalFlinkMemorySize.multiply(shuffleRangeFraction.fraction))
 &&
+                               derivedShuffleMemorySize.getBytes() < 
shuffleRangeFraction.maxSize.getBytes() &&
+                               derivedShuffleMemorySize.getBytes() > 
shuffleRangeFraction.minSize.getBytes()) {
+                               throw new 
IllegalConfigurationException(String.format(
+                                       "Derived Shuffle Memory size(%s) is 
within the min(%s) .. max(%s) range " +
+                                               "but it does not match 
configured Shuffle Memory fraction (%f).",
 
 Review comment:
   I think this error message is a bit confusing. It's not very intuitive what 
does "not matching the fraction" has to do with "is within the range".
   I would suggest something like:
   > Derived Shuffle Memory size (%s) does not match configured Shuffle Memory 
fraction (%f), while it has not been overwritten by the configured min (%s) / 
max (%s) constraints.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to