Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2447#discussion_r77313861
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/instance/SlotSharingGroupAssignment.java
 ---
    @@ -576,7 +560,7 @@ private void internalDisposeEmptySharedSlot(SharedSlot 
sharedSlot) {
                
                if (parent == null) {
                        // root slot, return to the instance.
    -                   
sharedSlot.getInstance().returnAllocatedSlot(sharedSlot);
    +                   sharedSlot.getOwner().returnAllocatedSlot(sharedSlot);
    --- End diff --
    
    Can we use `sharedSlot.releaseSlot` instead? It seems not so right to get 
the owner which is then used to call `returnAllocatedSlot` with the same slot. 
I think this violates the law of Demeter.
    
    Alternatively, we could add a method `returnSlot` to `Slot` which does: 
`owner.returnAllocatedSlot(this)`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to