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

    https://github.com/apache/flink/pull/4499#discussion_r138918917
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/RemoteInputChannel.java
 ---
    @@ -100,7 +122,16 @@ public RemoteInputChannel(
        }
     
        void assignExclusiveSegments(List<MemorySegment> segments) {
    --- End diff --
    
    This method is currently **adding** memory segments and multiple calls are 
allowed (making `initialCredit` reflect the newest call though). I know, we 
don't plan to call this multiple times, but there's also probably no harm. We 
should either
    
    1. rename the method to `addExclusiveSegments` and adapt the 
`initialCredit` (if we actually keep this), or
    2. implement the "assign" behaviour, i.e. recycle previously assigned 
elements and only use the new ones as exclusive buffers (for this you actually 
need the `initialCredit` but you may not be able to return previously added 
buffers immediately), or
    3. prevent the user from calling the method multiple times
    
    For simplicity, I'd go with number 1. What do you think?


---

Reply via email to