wsry commented on a change in pull request #11877:
URL: https://github.com/apache/flink/pull/11877#discussion_r662688120
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartition.java
##########
@@ -288,9 +288,7 @@ BufferAndBacklog pollBuffer() {
if (buffers.isEmpty()) {
flushRequested = false;
- }
-
- while (!buffers.isEmpty()) {
+ } else {
Review comment:
If there is only one buffer in the buffer queue, after all data is read,
the flushRequested flag will be turned off. Consider the following scenario
(correct me if I am wrong):
1. There is an unfinished buffer in the queue and all data is read.
2. Then the buffer is finished but no new data is appended. Note appending
data and finish buffer is not an atomic operation.
3. New buffer or event is added to the buffer queue.
4. When polling buffer, an empty buffer is at the head of the queue and we
already allocate a credit for it.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]