[ 
https://issues.apache.org/jira/browse/GOBBLIN-684?focusedWorklogId=200308&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-200308
 ]

ASF GitHub Bot logged work on GOBBLIN-684:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Feb/19 01:45
            Start Date: 19/Feb/19 01:45
    Worklog Time Spent: 10m 
      Work Description: sv2000 commented on pull request #2556: GOBBLIN-684: 
Ensure buffered messages are flushed before close() in K…
URL: https://github.com/apache/incubator-gobblin/pull/2556#discussion_r257866178
 
 

 ##########
 File path: 
gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java
 ##########
 @@ -47,6 +51,9 @@
   private final String topic;
   private final KafkaProducer<K, V> producer;
   private final Closer closer;
+  private final Queue<Future<RecordMetadata>> futures = new 
LinkedBlockingDeque<>();
 
 Review comment:
   Thanks! Added more comments to explain how to set the capacity for the 
buffer.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 200308)
    Time Spent: 40m  (was: 0.5h)

> Ensure buffered messages are flushed before close() in KafkaProducerPusher
> --------------------------------------------------------------------------
>
>                 Key: GOBBLIN-684
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-684
>             Project: Apache Gobblin
>          Issue Type: Improvement
>          Components: gobblin-metrics
>    Affects Versions: 0.15.0
>            Reporter: Sudarshan Vasudevan
>            Assignee: Sudarshan Vasudevan
>            Priority: Major
>             Fix For: 0.15.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Currently, when KafkaProducerPusher is closed, it invokes 
> KafkaProducer#close(). However,close() only guarantees delivery of in-flight 
> messages, not the messages in the producer buffer waiting to be sent out. 
> This results in data loss.
> The fix ensures that we call flush() before close(). As a result, any 
> buffered messages are immediately pushed out and we block until the messages 
> are acked. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to