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

Andrey Zagrebin commented on FLINK-15660:
-----------------------------------------

I agree one of the 'if's is probably redundant. The second 'else if' will never 
be executed atm. I believe the first 'if' is already covered by the next 
'if/else if'. In a long term, the next 'if/else if'  makes more sense for both 
static and dynamic covering -FLINK-14589- as well.

> Redundant AllocationID verification for allocateSlot in TaskSlotTable
> ---------------------------------------------------------------------
>
>                 Key: FLINK-15660
>                 URL: https://issues.apache.org/jira/browse/FLINK-15660
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Coordination
>    Affects Versions: 1.10.0
>            Reporter: xiajun
>            Priority: Major
>         Attachments: image-2020-01-19-15-46-42-664.png
>
>
> !image-2020-01-19-15-46-42-664.png!
>  
> In function TaskSlotTable::allocateSlot, first we will check whether 
> allocationId is exist, when exist we will refused this allocation, this was 
> introduced by FLINK-14589 . But in -FLINK-14189-, when allocationId exist, we 
> think this is valid, which is contradictory with the first check.
>  The code is following:
> [https://github.com/apache/flink/blob/310452e800355f0dcc4bc9dd26e9cecba263f3d6/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L261]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to