You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/03/04 19:57:50 UTC

[GitHub] [incubator-gobblin] ZihanLi58 opened a new pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method

ZihanLi58 opened a new pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method
URL: https://github.com/apache/incubator-gobblin/pull/2908
 
 
   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
   
   
   ### JIRA
   - [ ] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
       - https://issues.apache.org/jira/browse/GOBBLIN-1069
   
   
   ### Description
   - [ ] Here are some details about my PR, including screenshots (if applicable):
   Add NPE check in handleContainerCompletion method to make sure call the method twice for the same container will not fail the job
   
   
   
   ### Tests
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   Unit tests
   
   ### Commits
   - [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   

----------------------------------------------------------------
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] [incubator-gobblin] sv2000 commented on a change in pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method

Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method
URL: https://github.com/apache/incubator-gobblin/pull/2908#discussion_r388613538
 
 

 ##########
 File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java
 ##########
 @@ -620,7 +620,10 @@ private boolean shouldStickToTheSameNode(int containerExitStatus) {
    */
   protected void handleContainerCompletion(ContainerStatus containerStatus) {
     Map.Entry<Container, String> completedContainerEntry = this.containerMap.remove(containerStatus.getContainerId());
-
+    if (completedContainerEntry == null) {
 
 Review comment:
   @ZihanLi58 shouldn't we get a replacement container for this? The problem we are hitting NPE is that container allocation/completion are asynchronous calls and there is no guarantee that the callbacks are processed in the same order. In other words, handleContainerCompletion() callback may happen before onContainersAllocated(), which can cause NPE. In this scenario, we should be requesting a replacement container. 

----------------------------------------------------------------
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] [incubator-gobblin] ZihanLi58 commented on a change in pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method

Posted by GitBox <gi...@apache.org>.
ZihanLi58 commented on a change in pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method
URL: https://github.com/apache/incubator-gobblin/pull/2908#discussion_r387944305
 
 

 ##########
 File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java
 ##########
 @@ -620,7 +620,10 @@ private boolean shouldStickToTheSameNode(int containerExitStatus) {
    */
   protected void handleContainerCompletion(ContainerStatus containerStatus) {
     Map.Entry<Container, String> completedContainerEntry = this.containerMap.remove(containerStatus.getContainerId());
-
+    if (completedContainerEntry == null) {
 
 Review comment:
   We have met some NPE when the container completion happens. And we alway add the containerId to the map when one container is allocated and remove the id only inside this method. So we assume that there may be chances that for one completed container, this method will be called more than once. And in that scenario (the method has already be called once to handle this completion), we can say we no longer maintain this container. 

----------------------------------------------------------------
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] [incubator-gobblin] sv2000 commented on a change in pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method

Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method
URL: https://github.com/apache/incubator-gobblin/pull/2908#discussion_r388613538
 
 

 ##########
 File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java
 ##########
 @@ -620,7 +620,10 @@ private boolean shouldStickToTheSameNode(int containerExitStatus) {
    */
   protected void handleContainerCompletion(ContainerStatus containerStatus) {
     Map.Entry<Container, String> completedContainerEntry = this.containerMap.remove(containerStatus.getContainerId());
-
+    if (completedContainerEntry == null) {
 
 Review comment:
   @ZihanLi58 shouldn't we get a replacement container for this? One reason why we are hitting NPE is that container allocation/completion are asynchronous calls and there is no guarantee that the callbacks are processed in the same order. In other words, handleContainerCompletion() callback may happen before onContainersAllocated(), which can cause NPE. In this scenario, we should be requesting a replacement container. 

----------------------------------------------------------------
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] [incubator-gobblin] codecov-io commented on issue #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method
URL: https://github.com/apache/incubator-gobblin/pull/2908#issuecomment-594817912
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=h1) Report
   > Merging [#2908](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/dec3b91abb6ab3dc7223eaa3b19124cfe3c1d922?src=pr&el=desc) will **decrease** coverage by `<.01%`.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-gobblin/pull/2908/graphs/tree.svg?width=650&token=4MgURJ0bGc&height=150&src=pr)](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2908      +/-   ##
   ============================================
   - Coverage     45.86%   45.85%   -0.01%     
   + Complexity     9187     9185       -2     
   ============================================
     Files          1934     1934              
     Lines         72856    72858       +2     
     Branches       8032     8033       +1     
   ============================================
   - Hits          33412    33410       -2     
   - Misses        36380    36383       +3     
   - Partials       3064     3065       +1
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...main/java/org/apache/gobblin/yarn/YarnService.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2908/diff?src=pr&el=tree#diff-Z29iYmxpbi15YXJuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3lhcm4vWWFyblNlcnZpY2UuamF2YQ==) | `15.23% <0%> (-0.09%)` | `4 <0> (ø)` | |
   | [.../org/apache/gobblin/metrics/RootMetricContext.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2908/diff?src=pr&el=tree#diff-Z29iYmxpbi1tZXRyaWNzLWxpYnMvZ29iYmxpbi1tZXRyaWNzLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vbWV0cmljcy9Sb290TWV0cmljQ29udGV4dC5qYXZh) | `78.12% <0%> (-1.57%)` | `15% <0%> (-1%)` | |
   | [.../org/apache/gobblin/cluster/GobblinTaskRunner.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2908/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvR29iYmxpblRhc2tSdW5uZXIuamF2YQ==) | `64.62% <0%> (-0.44%)` | `28% <0%> (-1%)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=footer). Last update [dec3b91...9ddf6b6](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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] [incubator-gobblin] codecov-io edited a comment on issue #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method
URL: https://github.com/apache/incubator-gobblin/pull/2908#issuecomment-594817912
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=h1) Report
   > Merging [#2908](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/dec3b91abb6ab3dc7223eaa3b19124cfe3c1d922?src=pr&el=desc) will **decrease** coverage by `<.01%`.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-gobblin/pull/2908/graphs/tree.svg?width=650&token=4MgURJ0bGc&height=150&src=pr)](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2908      +/-   ##
   ============================================
   - Coverage     45.86%   45.85%   -0.01%     
   + Complexity     9187     9185       -2     
   ============================================
     Files          1934     1934              
     Lines         72856    72858       +2     
     Branches       8032     8033       +1     
   ============================================
   - Hits          33412    33410       -2     
   - Misses        36380    36383       +3     
   - Partials       3064     3065       +1
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...main/java/org/apache/gobblin/yarn/YarnService.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2908/diff?src=pr&el=tree#diff-Z29iYmxpbi15YXJuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3lhcm4vWWFyblNlcnZpY2UuamF2YQ==) | `15.23% <0%> (-0.09%)` | `4 <0> (ø)` | |
   | [.../org/apache/gobblin/metrics/RootMetricContext.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2908/diff?src=pr&el=tree#diff-Z29iYmxpbi1tZXRyaWNzLWxpYnMvZ29iYmxpbi1tZXRyaWNzLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vbWV0cmljcy9Sb290TWV0cmljQ29udGV4dC5qYXZh) | `78.12% <0%> (-1.57%)` | `15% <0%> (-1%)` | |
   | [.../org/apache/gobblin/cluster/GobblinTaskRunner.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2908/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvR29iYmxpblRhc2tSdW5uZXIuamF2YQ==) | `64.62% <0%> (-0.44%)` | `28% <0%> (-1%)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=footer). Last update [dec3b91...9ddf6b6](https://codecov.io/gh/apache/incubator-gobblin/pull/2908?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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] [incubator-gobblin] asfgit closed pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method
URL: https://github.com/apache/incubator-gobblin/pull/2908
 
 
   

----------------------------------------------------------------
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] [incubator-gobblin] autumnust commented on a change in pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method

Posted by GitBox <gi...@apache.org>.
autumnust commented on a change in pull request #2908: [GOBBLIN-1069] Add NPE check in handleContainerCompletion method
URL: https://github.com/apache/incubator-gobblin/pull/2908#discussion_r387903741
 
 

 ##########
 File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java
 ##########
 @@ -620,7 +620,10 @@ private boolean shouldStickToTheSameNode(int containerExitStatus) {
    */
   protected void handleContainerCompletion(ContainerStatus containerStatus) {
     Map.Entry<Container, String> completedContainerEntry = this.containerMap.remove(containerStatus.getContainerId());
-
+    if (completedContainerEntry == null) {
 
 Review comment:
   In what kind of scenarios will it happen, when you say " we don't maintain this container " ? 

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