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/05/08 09:44:41 UTC

[GitHub] [flink] SteNicholas opened a new pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

SteNicholas opened a new pull request #12033:
URL: https://github.com/apache/flink/pull/12033


   ## What is the purpose of the change
   
   *`HeapMapState#iterator` could return a null iterator when using Heap statebackend, it should better return empty map for ` NullAwareMapIterator`.*
   
   
   ## Brief change log
   
     - *`HeapMapState#iterator` return empty map when stateTable doesn't contain current namespace table.*
   
   ## Verifying this change
   
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / no)
     - The serializers: (yes / no / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / no / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / no / don't know)
     - The S3 file system connector: (yes / no / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   


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



[GitHub] [flink] SteNicholas commented on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-626495937


   @Myasuka According to the discussion, I have already align the behavior of `HeapMapState` #entries(), #keys(), #values(), and #iterator() and `RocksDBMapState` #entries()  to return empty iterator. Please review this again, thanks.


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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ad38204aa74eef633364b2a8d52045d85288cce7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947",
       "triggerID" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cffd608eb2485411f3e38d3773c9562e2cdae7c6",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=975",
       "triggerID" : "cffd608eb2485411f3e38d3773c9562e2cdae7c6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cffd608eb2485411f3e38d3773c9562e2cdae7c6 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=975) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] SteNicholas commented on a change in pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #12033:
URL: https://github.com/apache/flink/pull/12033#discussion_r422436572



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapMapState.java
##########
@@ -158,7 +159,7 @@ public boolean contains(UK userKey) {
 	@Override
 	public Iterator<Map.Entry<UK, UV>> iterator() {
 		Map<UK, UV> userMap = stateTable.get(currentNamespace);
-		return userMap == null ? null : userMap.entrySet().iterator();
+		return userMap == null ? Collections.<UK, UV>emptyMap().entrySet().iterator() : userMap.entrySet().iterator();

Review comment:
       @Myasuka Yeah, I would like to modify `NullAwareMapIterator` to solve the `NullException` and add unit test to cover `null` behavior case.




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



[GitHub] [flink] Myasuka commented on a change in pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
Myasuka commented on a change in pull request #12033:
URL: https://github.com/apache/flink/pull/12033#discussion_r422479353



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapMapState.java
##########
@@ -158,7 +159,7 @@ public boolean contains(UK userKey) {
 	@Override
 	public Iterator<Map.Entry<UK, UV>> iterator() {
 		Map<UK, UV> userMap = stateTable.get(currentNamespace);
-		return userMap == null ? null : userMap.entrySet().iterator();
+		return userMap == null ? Collections.<UK, UV>emptyMap().entrySet().iterator() : userMap.entrySet().iterator();

Review comment:
       Besides walking around in `NullAwareMapIterator`, I think a discussion is worthwhile and launched a [thread](http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-Align-the-behavior-of-internal-return-result-of-MapState-entries-keys-values-and-iterator-td41269.html) to discuss this. Hope you could also take a look.




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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947",
       "triggerID" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d56a49b4340fc49966898cda41447bdf7ebb53bd Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947",
       "triggerID" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cffd608eb2485411f3e38d3773c9562e2cdae7c6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=975",
       "triggerID" : "cffd608eb2485411f3e38d3773c9562e2cdae7c6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d56a49b4340fc49966898cda41447bdf7ebb53bd Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947) 
   * cffd608eb2485411f3e38d3773c9562e2cdae7c6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=975) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947",
       "triggerID" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 188f7416604519b214ef83b11bb443956f059736 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892) 
   * d56a49b4340fc49966898cda41447bdf7ebb53bd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947) 
   
   <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



[GitHub] [flink] flinkbot commented on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625737401


   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 ad38204aa74eef633364b2a8d52045d85288cce7 (Fri May 08 09:52:10 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-17015).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 188f7416604519b214ef83b11bb443956f059736 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892) 
   
   <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



[GitHub] [flink] Myasuka commented on a change in pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
Myasuka commented on a change in pull request #12033:
URL: https://github.com/apache/flink/pull/12033#discussion_r422154704



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapMapState.java
##########
@@ -158,7 +159,7 @@ public boolean contains(UK userKey) {
 	@Override
 	public Iterator<Map.Entry<UK, UV>> iterator() {
 		Map<UK, UV> userMap = stateTable.get(currentNamespace);
-		return userMap == null ? null : userMap.entrySet().iterator();
+		return userMap == null ? Collections.<UK, UV>emptyMap().entrySet().iterator() : userMap.entrySet().iterator();

Review comment:
       Please take a look at [RocksDBMapState#entries](https://github.com/apache/flink/blob/4959ebfc349bb80f88582f9ef2d60d09f1140737/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBMapState.java#L169-L174), it will return `null` if the iterator is empty. 
   Moreover, except `HeapMapState#iterator`, other interfaces like `HeapMapState#keys` and `HeapMapState#values` will also return null if empty.
   I prefer you could handle the `null` problem in `NullAwareMapIterator` or `StateMapView`. Otherwise, we could launch a discussion thread to align the behavior of `HeapMapState` and `RocksDBMapState`.




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



[GitHub] [flink] flinkbot commented on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ad38204aa74eef633364b2a8d52045d85288cce7 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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ad38204aa74eef633364b2a8d52045d85288cce7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826) 
   * 188f7416604519b214ef83b11bb443956f059736 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



[GitHub] [flink] SteNicholas commented on a change in pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #12033:
URL: https://github.com/apache/flink/pull/12033#discussion_r422484721



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapMapState.java
##########
@@ -158,7 +159,7 @@ public boolean contains(UK userKey) {
 	@Override
 	public Iterator<Map.Entry<UK, UV>> iterator() {
 		Map<UK, UV> userMap = stateTable.get(currentNamespace);
-		return userMap == null ? null : userMap.entrySet().iterator();
+		return userMap == null ? Collections.<UK, UV>emptyMap().entrySet().iterator() : userMap.entrySet().iterator();

Review comment:
       @Myasuka I have already modified`NullAwareMapIterator` to add mapIterator nullable check, and replied the thread you mentioned. In this pull request, I think #iterator should better return empty iterator, and `NullAwareMapIterator` necessarily check the mapIterator.




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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ad38204aa74eef633364b2a8d52045d85288cce7 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826) 
   * 188f7416604519b214ef83b11bb443956f059736 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892) 
   
   <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



[GitHub] [flink] SteNicholas removed a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
SteNicholas removed a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-626495937


   @Myasuka According to the discussion, I have already align the behavior of `HeapMapState` #entries(), #keys(), #values(), and #iterator() and `RocksDBMapState` #entries()  to return empty iterator. Please review this again, thanks.


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



[GitHub] [flink] Myasuka commented on a change in pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
Myasuka commented on a change in pull request #12033:
URL: https://github.com/apache/flink/pull/12033#discussion_r422155461



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapMapState.java
##########
@@ -158,7 +159,7 @@ public boolean contains(UK userKey) {
 	@Override
 	public Iterator<Map.Entry<UK, UV>> iterator() {
 		Map<UK, UV> userMap = stateTable.get(currentNamespace);
-		return userMap == null ? null : userMap.entrySet().iterator();
+		return userMap == null ? Collections.<UK, UV>emptyMap().entrySet().iterator() : userMap.entrySet().iterator();

Review comment:
       Besides, we'd better to add unit test to cover this unexpected `null` behavior.




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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ad38204aa74eef633364b2a8d52045d85288cce7 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826) 
   
   <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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 188f7416604519b214ef83b11bb443956f059736 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892) 
   * d56a49b4340fc49966898cda41447bdf7ebb53bd 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



[GitHub] [flink] flinkbot edited a comment on pull request #12033: [FLINK-17015]Fix NPE from NullAwareMapIterator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12033:
URL: https://github.com/apache/flink/pull/12033#issuecomment-625870561


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=826",
       "triggerID" : "ad38204aa74eef633364b2a8d52045d85288cce7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "188f7416604519b214ef83b11bb443956f059736",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=892",
       "triggerID" : "188f7416604519b214ef83b11bb443956f059736",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947",
       "triggerID" : "d56a49b4340fc49966898cda41447bdf7ebb53bd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cffd608eb2485411f3e38d3773c9562e2cdae7c6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cffd608eb2485411f3e38d3773c9562e2cdae7c6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d56a49b4340fc49966898cda41447bdf7ebb53bd Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=947) 
   * cffd608eb2485411f3e38d3773c9562e2cdae7c6 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