[FLINK-13100][network] Fix the bug of throwing IOException while FileChannelBoundedData#nextBuffer
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.
Showing
想要评论请 注册 或 登录