KarmaGYZ commented on a change in pull request #13051:
URL: https://github.com/apache/flink/pull/13051#discussion_r466242764



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/TaskManagerCheckInSlotManagerTest.java
##########
@@ -213,6 +212,21 @@ public void 
testTaskManagerIsNotReleasedInCaseOfConcurrentAllocation() throws Ex
                }
        }
 
+       private void checkTaskManagerTimeout(int redundantTaskManagerNum) 
throws Exception {
+               Executor executor = TestingUtils.defaultExecutor();
+               
canBeReleasedFuture.set(CompletableFuture.completedFuture(true));
+               try (SlotManager slotManager = SlotManagerBuilder
+                       .newBuilder()
+                       .setTaskManagerTimeout(Time.milliseconds(10L))
+                       .setRedundantTaskManagerNum(redundantTaskManagerNum)
+                       .build()) {
+
+                       slotManager.start(resourceManagerId, executor, 
resourceManagerActions);

Review comment:
       Could use `buildAndStartWithDirectExec#buildAndStartWithDirectExec` 
instead.

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerImpl.java
##########
@@ -1256,7 +1256,10 @@ void checkTaskManagerTimeoutsAndRedundancy() {
                        }
 
                        int slotsDiff = redundantTaskManagerNum * 
numSlotsPerWorker - freeSlots.size();
-                       if (slotsDiff > 0) {
+                       if (freeSlots.size() == slots.size()) {

Review comment:
       Ok, that makes sense to me.




----------------------------------------------------------------
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]


Reply via email to