tillrohrmann commented on a change in pull request #7662: [FLINK-10431] 
Extraction of scheduling-related code from SlotPool into preliminary Scheduler 
(rebased)
URL: https://github.com/apache/flink/pull/7662#discussion_r255130889
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SingleLogicalSlot.java
 ##########
 @@ -171,20 +170,17 @@ public void release(Throwable cause) {
 
        private void signalPayloadRelease(Throwable cause) {
                tryAssignPayload(TERMINATED_PAYLOAD);
-               payload.failAsync(cause); //TODO this goes from the pool 
against the execution, has to by sync'ed back into the jm main thread
+               payload.failSync(cause);
        }
 
        private void returnSlotToOwner(CompletableFuture<?> 
terminalStateFuture) {
                terminalStateFuture
-                       .handle((Object ignored, Throwable throwable) -> {
+                       .whenComplete((Object ignored, Throwable throwable) -> {
                                if (state == State.RELEASING) {
-                                       return 
slotOwner.returnAllocatedSlot(this);
-                               } else {
-                                       return 
CompletableFuture.completedFuture(true);
+                                       slotOwner.returnAllocatedSlot(this);
                                }
                        })
-                       .thenCompose(Function.identity())
-                       .whenComplete( //TODO this could be inside the job 
master main thread, should be inside slot pool main thread
+                       .whenComplete(
 
 Review comment:
   I think the two `whenComplete` calls can be fused.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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