nlu90 commented on a change in pull request #17643:
URL: https://github.com/apache/flink/pull/17643#discussion_r742253290



##########
File path: 
flink-connectors/flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/source/reader/split/PulsarPartitionSplitReaderBase.java
##########
@@ -114,6 +116,9 @@ protected PulsarPartitionSplitReaderBase(
             try {
                 Duration timeout = deadline.timeLeftIfAny();
                 Message<byte[]> message = pollMessage(timeout);
+                if (message == null) {
+                    break;
+                }
 
                 // Deserialize message.
                 collector.setMessage(message);

Review comment:
       why break directly after one message polling failure? should the change 
here be:
   ```
   if (message != null) {
       collector.setMessage(message)
   }
   ```
   
   This way, the for loop will keep trying until one of the exit condition met




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


Reply via email to