pnowojski commented on a change in pull request #9062: [FLINK-13100][network] 
Fix the bug of throwing IOException while FileChannelBoundedData#nextBuffer
URL: https://github.com/apache/flink/pull/9062#discussion_r301964266
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BoundedBlockingSubpartition.java
 ##########
 @@ -198,9 +198,8 @@ public ResultSubpartitionView 
createReadView(BufferAvailabilityListener availabi
 
                        availability.notifyDataAvailable();
 
 Review comment:
   Can we rephrase the commit message a bit? For example: 
   ```
   The implementation of FileChannelBoundedData#nextBuffer assumes that there 
is always an available buffer, otherwise an IOException is thrown and it always 
assumes that pool of two buffers is enough (before using the 3rd buffer, first 
one was expected to be recycled already). But in the case of pending flush 
operation (when the
   socket channel is not writable while netty thread is calling writeAndFlush 
method), the first fetched buffer from
   FileChannelBoundedData has not been recycled while fetching the second 
buffer to trigger next read ahead, which breaks the above assumption.
   
   In order to fix this problem, we make read ahead is not always available for 
FileChannelBoundedData.
   If there are no available buffers to read the next data, we retrigger the 
read ahead while recycling buffer via
   ResultSubpartitionView#notifyDataAvailable.
   ```

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