GitHub user sebastiansemmle opened a pull request:

    https://github.com/apache/flink/pull/5245

    [FLINK-8372] Fix NPEs when stopping worker nodes and adding tasks.

    ## What is the purpose of the change
    
    Fix potential `NullPointerExceptions` when stopping worker nodes and adding 
tasks.
    [lgtm.com](https://lgtm.com) detected these two NPEs for `apache/flink` 
which can be viewed 
[here](https://lgtm.com/projects/g/apache/flink/alerts/?mode=tree&severity=error&rule=3960073)
    
    ## Brief change log
    
    - The first commit fixes `YarnResourceManager.stopWorker()`, which, when 
given a null reference, will attempt to obtain and print the resource id, which 
in turn will fail. I opted to change the commit message as well in order to 
accommodate for the missing id.
    - The second commit fixes `TaskSlotTable.addTask()`, which, when given a 
null reference will throw a `SlotNotFoundException`. However, since it attempts 
to get an allocation id from that null reference, that exception will be 
shadowed by an NPE.
    
    ## Verifying this change
    
    *(Please pick either of the following options)*
    
    This change is a trivial rework 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 / don't know)
      - The runtime per-record code paths (performance sensitive): (no / don't 
know)
      - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no / don't know)
      - The S3 file system connector: (no / don't know)
    
    ## Documentation
    
      - Does this pull request introduce a new feature? (no)
      - If yes, how is the feature documented? (not applicable)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sebastiansemmle/flink fix-NPEs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/5245.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5245
    
----
commit 47bfeba899e54a3c4613c81a8a7a4c66b17f0cfd
Author: Sebastian Bauersfeld <sebastian@...>
Date:   2018-01-05T11:24:08Z

    [FLINK-8372] Fix NullPointerException when stopping YarnWorkerNodes

commit 567c764eb4abef2d4847ebe946b4723878589b33
Author: Sebastian Bauersfeld <sebastian@...>
Date:   2018-01-05T11:24:42Z

    [FLINK-8372] Fix NullPointerException when adding Tasks

----


---

Reply via email to