[ 
https://issues.apache.org/jira/browse/FLINK-7838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16222550#comment-16222550
 ] 

ASF GitHub Bot commented on FLINK-7838:
---------------------------------------

Github user GJL commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4915#discussion_r147442314
  
    --- Diff: 
flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer011.java
 ---
    @@ -563,7 +553,7 @@ public void close() throws Exception {
                        asyncException = ExceptionUtils.firstOrSuppressed(e, 
asyncException);
                }
                try {
    -                   producersPool.close();
    +                   producersPool.ifPresent(pool -> pool.close());
    --- End diff --
    
    I am not adamant about it but using `Optional` in private fields is not 
without controversy: https://stackoverflow.com/a/26328555
    
    Also, `ifPresent(pool -> pool.close()` only works because `close` does not 
declare any checked exceptions. If it did, the code would not compile.


> Kafka011ProducerExactlyOnceITCase do not finish
> -----------------------------------------------
>
>                 Key: FLINK-7838
>                 URL: https://issues.apache.org/jira/browse/FLINK-7838
>             Project: Flink
>          Issue Type: Bug
>          Components: Kafka Connector
>    Affects Versions: 1.4.0
>            Reporter: Piotr Nowojski
>            Assignee: Piotr Nowojski
>            Priority: Blocker
>             Fix For: 1.4.0
>
>         Attachments: initTransactions_deadlock.txt, log.txt
>
>
> See attached log



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to