Github user pnowojski commented on a diff in the pull request: https://github.com/apache/flink/pull/4915#discussion_r147652950 --- 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 know about this controversy/discussion. However I don't know in what universe nullable fields are better compared to `Optional` fields :|
---