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

    https://github.com/apache/flink/pull/2108#discussion_r67248839
  
    --- Diff: 
flink-streaming-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducerBase.java
 ---
    @@ -276,6 +314,41 @@ public void close() throws Exception {
                checkErroneous();
        }
     
    +   // ------------------- Logic for handling checkpoint flushing 
-------------------------- //
    +
    +   private void acknowledgeMessage() {
    +           if(!flushOnCheckpoint) {
    +                   // the logic is disabled
    +                   return;
    +           }
    +           pendingRecords--;
    +   }
    +
    +   @Override
    +   public Serializable snapshotState(long checkpointId, long 
checkpointTimestamp) {
    +           if(flushOnCheckpoint) {
    +                   // flushing is activated: We need to wait until 
pendingRecords is 0
    +                   while(pendingRecords > 0) {
    +                           try {
    +                                   Thread.sleep(10);
    --- End diff --
    
    Any reason to sleep instead of calling producer.flush() to wait for the 
acks?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to