wuchong commented on a change in pull request #11688: [FLINK-17080] Fix
possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#discussion_r406639484
##########
File path: flink-java/src/main/java/org/apache/flink/api/java/Utils.java
##########
@@ -138,6 +138,12 @@ public void writeRecord(T record) throws IOException {
@Override
public void close() {
+ // when the sink is up but not initialized and the job
fails due to other operators,
+ // it is possible that close() is called when open() is
not called,
+ // so we have to do this null check
+ if (accumulator == null) {
+ accumulator = new SerializedListAccumulator<>();
Review comment:
But the case is job failed, I think it's hard to make sure the accumulator
is in result even if job is failed. What if the operator/task/container is
never aroused?
----------------------------------------------------------------
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