You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/14 13:28:07 UTC

[GitHub] [flink] StephanEwen commented on a change in pull request #12151: [FLINK-16383] Set close = true in monitor/lock scope in KafkaProducer

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