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

MENG DING commented on YARN-4138:
---------------------------------

Hi, [~jianhe]

Thanks for reviewing the code. 

* I think you are right that there could be a race condition where 
rmContainer.getLastConfirmedResource() (called first) is 2G, and the 
rmContainer.getAllocatedResource() (called next) becomes 1G, causing the 
resource delta to become positive.

I think the solution is to synchronize the following block, such that both 
rmContainer.getLastConfirmedResource() and rmContainer.getAllocatedResource() 
will be 1G, so the resource delta is 0, and the decreaseContainer call will be 
skipped.
{code}
    SchedContainerChangeRequest decreaseRequest =
        new SchedContainerChangeRequest(
            schedulerNode, rmContainer,
                rmContainer.getLastConfirmedResource());
    decreaseContainer(decreaseRequest,
        getCurrentAttemptForContainer(containerId));
{code}

* I don't quite understand the concern about the API semantics. If the above is 
fixed, is the API semantics still a concern to you?

* bq. revert format only changes in RMContainerChangeResourceEvent
Will do


> Roll back container resource allocation after resource increase token expires
> -----------------------------------------------------------------------------
>
>                 Key: YARN-4138
>                 URL: https://issues.apache.org/jira/browse/YARN-4138
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: api, nodemanager, resourcemanager
>            Reporter: MENG DING
>            Assignee: MENG DING
>         Attachments: YARN-4138-YARN-1197.1.patch, YARN-4138-YARN-1197.2.patch
>
>
> In YARN-1651, after container resource increase token expires, the running 
> container is killed.
> This ticket will change the behavior such that when a container resource 
> increase token expires, the resource allocation of the container will be 
> reverted back to the value before the increase.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to