yanghua commented on a change in pull request #8871: [FLINK-12976] Bump Kafka
client version to 2.3.0 for universal Kafka connector
URL: https://github.com/apache/flink/pull/8871#discussion_r298900461
##########
File path:
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer.java
##########
@@ -683,13 +682,13 @@ public void close() throws FlinkKafkaException {
} finally {
// We may have to close producer of the current
transaction in case some exception was thrown before
// the normal close routine finishes.
- if (currentTransaction() != null) {
-
IOUtils.closeQuietly(currentTransaction().producer);
- }
- // Make sure all the producers for pending transactions
are closed.
- pendingTransactions().forEach(transaction ->
-
IOUtils.closeQuietly(transaction.getValue().producer)
- );
+// if (currentTransaction() != null) {
Review comment:
If we comment this code snippet then the test case will be passed.
Otherwise, the log will display this log message `Aborting incomplete
transaction due to shutdown ...` and the transcation state would transform from
ongoing to `PrepareAbort`.
One idea is to get the ` TransactionManager.State` from `TransactionManager`
in Kafka client before closing the producer. WDYT? @aljoscha and @pnowojski
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services