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/04/09 09:50:39 UTC

[GitHub] [flink] TsReaper opened a new pull request #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper

TsReaper opened a new pull request #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688
 
 
   ## What is the purpose of the change
   
   This PR fixes the possible NPE when closing `Utils.CollectHelper`. 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. Currently `Utils.CollectHelper` does not deal with this case.
   
   See [FLINK-16636](https://issues.apache.org/jira/browse/FLINK-16636) for more detailed discussion.
   
   ## Brief change log
   
   - Fix possible NPE in Utils.CollectHelper
   
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
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 failing, 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159567931",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159749081",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7316",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a527ae4d52b18111f3ebb232185f82018eb71002",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a527ae4d52b18111f3ebb232185f82018eb71002",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7c930758799236ed9ad6a20ff7b26f62114ee402 Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/159749081) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7316) 
   * a527ae4d52b18111f3ebb232185f82018eb71002 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159567931",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ecd5949bd414f4b1b32f461167e1b86a8047df61 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/159567931) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ecd5949bd414f4b1b32f461167e1b86a8047df61 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159567931",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159749081",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7316",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a527ae4d52b18111f3ebb232185f82018eb71002",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a527ae4d52b18111f3ebb232185f82018eb71002",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7c930758799236ed9ad6a20ff7b26f62114ee402 Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/159749081) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7316) 
   * a527ae4d52b18111f3ebb232185f82018eb71002 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159567931",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159749081",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7316",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a527ae4d52b18111f3ebb232185f82018eb71002",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a527ae4d52b18111f3ebb232185f82018eb71002",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ecd5949bd414f4b1b32f461167e1b86a8047df61 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/159567931) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279) 
   * 7c930758799236ed9ad6a20ff7b26f62114ee402 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/159749081) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7316) 
   * a527ae4d52b18111f3ebb232185f82018eb71002 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159567931",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ecd5949bd414f4b1b32f461167e1b86a8047df61 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/159567931) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159567931",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ecd5949bd414f4b1b32f461167e1b86a8047df61 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/159567931) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279) 
   * 7c930758799236ed9ad6a20ff7b26f62114ee402 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#discussion_r406634954
 
 

 ##########
 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:
   Why not just skipt adding this accumulator into context?

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] wuchong merged pull request #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
wuchong merged pull request #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688
 
 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] TsReaper commented on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
TsReaper commented on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-613198777
 
 
   Travis passed: https://travis-ci.org/github/TsReaper/flink/builds/673323394

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159567931",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159749081",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7316",
       "triggerID" : "7c930758799236ed9ad6a20ff7b26f62114ee402",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ecd5949bd414f4b1b32f461167e1b86a8047df61 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/159567931) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279) 
   * 7c930758799236ed9ad6a20ff7b26f62114ee402 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/159749081) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7316) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #11688: [FLINK-17080] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
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 failing, I think it's hard to guarantee 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611445615
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159567931",
       "triggerID" : "ecd5949bd414f4b1b32f461167e1b86a8047df61",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ecd5949bd414f4b1b32f461167e1b86a8047df61 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/159567931) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7279) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] TsReaper commented on a change in pull request #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
TsReaper commented on a change in pull request #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#discussion_r406637302
 
 

 ##########
 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:
   The user of this `CollectHelper` expects this accumulator to appear in the result. Not adding this accumulator will result in additional checks on the user side.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11688: [FLINK-16636] Fix possible NPE in Utils.CollectHelper
URL: https://github.com/apache/flink/pull/11688#issuecomment-611440512
 
 
   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit ecd5949bd414f4b1b32f461167e1b86a8047df61 (Thu Apr 09 09:54:25 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>

----------------------------------------------------------------
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


With regards,
Apache Git Services