You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/05/16 01:38:22 UTC

[GitHub] [pulsar] jiazhai commented on a change in pull request #4267: [Issue-4266][pulsar-flink] Flink Pulsar Producer should reused across threads

jiazhai commented on a change in pull request #4267: [Issue-4266][pulsar-flink] Flink Pulsar Producer should reused across threads
URL: https://github.com/apache/pulsar/pull/4267#discussion_r284511502
 
 

 ##########
 File path: pulsar-flink/src/main/java/org/apache/flink/batch/connectors/pulsar/BasePulsarOutputFormat.java
 ##########
 @@ -85,7 +90,8 @@ public void configure(Configuration configuration) {
 
     @Override
     public void open(int taskNumber, int numTasks) throws IOException {
-        this.producer = getProducerInstance();
+        producer = getProducerInstance();
+        producerRefCnt.incrementAndGet();
 
 Review comment:
   How about move this ref change into the `synchronized` block of `getProducerInstance`? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services