You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by ffbin <gi...@git.apache.org> on 2015/08/05 04:23:23 UTC

[GitHub] flink pull request: [FLINK-2486]Remove unwanted null check in remo...

GitHub user ffbin opened a pull request:

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

    [FLINK-2486]Remove unwanted null check in removeInstance function

    removeInstance() is called in getFreeSlotForTask()/getNewSlotForSharingGroup()/handleNewSlot()/instanceDied()/newInstanceAvailable(). 
    1.getFreeSlotForTask()/getNewSlotForSharingGroup()/handleNewSlot() only catch InstanceDiedException, if instance is null, removeInstance() will not work.
    2.instanceDied()/newInstanceAvailable() has check instance ant the head of function,so the instance parameter of removeInstance() is not null.
    So null check of instance  in removeInstance() is unwanted.

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

    $ git pull https://github.com/ffbin/flink FLINK-2486

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

    https://github.com/apache/flink/pull/989.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 #989
    
----
commit 32c81aef41a46b47b591b04cb20914a32ddac9b8
Author: ffbin <86...@qq.com>
Date:   2015-08-05T01:48:51Z

    [FLINK-2486]Remove unwanted null check in removeInstance function

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2486]Remove unwanted null check in remo...

Posted by HuangWHWHW <gi...@git.apache.org>.
Github user HuangWHWHW commented on the pull request:

    https://github.com/apache/flink/pull/989#issuecomment-127822096
  
    The Instance in removeInstance()  is always not null.
    Test cannot cover these lines.
    Look good to merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2486]Remove unwanted null check in remo...

Posted by ffbin <gi...@git.apache.org>.
Github user ffbin closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2486]Remove unwanted null check in remo...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/989#issuecomment-131165838
  
    Sorry for catching this so late.
    
    I actually put such "sanity checks" in a lot of places in the code I write, and they have served well.
    In the case where everything is all right, they are not necessary.
    As soon as someone changes the code that calls this function (may happen in the future), this can help catching bugs (fail fast principle).
    
    I would like to keep such checks, they really do not hurt, and possibly help in the future.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2486]Remove unwanted null check in remo...

Posted by ffbin <gi...@git.apache.org>.
Github user ffbin commented on the pull request:

    https://github.com/apache/flink/pull/989#issuecomment-131276961
  
    @StephanEwen Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---