You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/30 06:24:00 UTC

[jira] [Commented] (FLINK-7741) Fix NPE when throw new SlotNotFoundException

    [ https://issues.apache.org/jira/browse/FLINK-7741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16186921#comment-16186921 ] 

ASF GitHub Bot commented on FLINK-7741:
---------------------------------------

GitHub user yew1eb opened a pull request:

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

    [FLINK-7741][build] Fix NPE when throw new SlotNotFoundException

    if taskSlot is null  then **throw new SlotNotFoundException(taskSlot.getAllocationId());** will have NPE.
    the code segment in **org.apache.flink.runtime.taskexecutor.slot.TaskSlotTable** class: 
    ```
    	public boolean addTask(Task task) throws SlotNotFoundException, SlotNotActiveException {
    		Preconditions.checkNotNull(task);
    
    		TaskSlot taskSlot = getTaskSlot(task.getAllocationId());
    
    		if (taskSlot != null) {
    			if (taskSlot.isActive(task.getJobID(), task.getAllocationId())) {
    				if (taskSlot.add(task)) {
    					taskSlotMappings.put(task.getExecutionId(), new TaskSlotMapping(task, taskSlot));
    
    					return true;
    				} else {
    					return false;
    				}
    			} else {
    				throw new SlotNotActiveException(task.getJobID(), task.getAllocationId());
    			}
    		} else {
    			throw new SlotNotFoundException(taskSlot.getAllocationId());
    		}
    	}
    ```


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

    $ git pull https://github.com/yew1eb/flink FLINK-7741

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

    https://github.com/apache/flink/pull/4753.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 #4753
    
----
commit 3c0da5b5ab1855c97b4663f86a173d820f85959f
Author: yew1eb <ye...@gmail.com>
Date:   2017-09-30T06:18:14Z

    Fix NPE when throw new SlotNotFoundException

----


> Fix NPE when throw new SlotNotFoundException
> --------------------------------------------
>
>                 Key: FLINK-7741
>                 URL: https://issues.apache.org/jira/browse/FLINK-7741
>             Project: Flink
>          Issue Type: Bug
>          Components: Build System
>    Affects Versions: 1.3.2
>            Reporter: Hai Zhou UTC+8
>            Assignee: Hai Zhou UTC+8
>             Fix For: 1.4.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)