StephanEwen commented on a change in pull request #12151:
URL: https://github.com/apache/flink/pull/12151#discussion_r425134302



##########
File path: 
flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/FlinkKafkaProducer.java
##########
@@ -190,17 +192,19 @@ public void sendOffsetsToTransaction(Map<TopicPartition, 
OffsetAndMetadata> offs
 
        @Override
        public void close() {
-               closed = true;
                synchronized (producerClosingLock) {
                        kafkaProducer.close();
+                       LOG.debug("Closed internal KafkaProducer {}. 
Stacktrace: {}", System.identityHashCode(this), 
Joiner.on("\n").join(Thread.currentThread().getStackTrace()));

Review comment:
       This uses eager string concatenation in a lazy parameter, which is 
typically a blocker.
   Now, this is not a performance critical path, but I would still suggest to 
avoid this, because it sets a bad example for other contributors to immitate 
(in then more critical parts).




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to