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

Zhaohui Xin edited comment on YARN-8655 at 2/12/19 7:05 AM:
------------------------------------------------------------

[~wilfreds] Thanks for your reply. I think it's not reasonable to process the 
application twice, because once we preempt containers for this app, we will 
satisfy both fairshareStarvation  and minshareStarvation.
{code:java}
Resource getStarvation() {
  return Resources.add(fairshareStarvation, minshareStarvation);
}
{code}


was (Author: uranus):
[~wilfreds] Thanks for your reply. I think it's not reasonable to process the 
application twice, because once we preempt containers for this app, we will 
consider both fairshareStarvation  and minshareStarvation.
{code:java}
Resource getStarvation() {
  return Resources.add(fairshareStarvation, minshareStarvation);
}
{code}

> FairScheduler: FSStarvedApps is not thread safe
> -----------------------------------------------
>
>                 Key: YARN-8655
>                 URL: https://issues.apache.org/jira/browse/YARN-8655
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: yarn
>    Affects Versions: 3.0.0
>            Reporter: Zhaohui Xin
>            Assignee: Zhaohui Xin
>            Priority: Major
>         Attachments: YARN-8655.002.patch, YARN-8655.patch
>
>
> *FSStarvedApps is not thread safe, this may make one starve app is processed 
> for two times continuously.*
> For example, when app1 is *fair share starved*, it has been added to 
> appsToProcess. After that, app1 is taken but appBeingProcessed is not yet 
> update to app1. At the moment, app1 is *starved by min share*, so this app 
> is added to appsToProcess again! Because appBeingProcessed is null and 
> appsToProcess also have not this one. 
> {code:java}
> void addStarvedApp(FSAppAttempt app) {
> if (!app.equals(appBeingProcessed) && !appsToProcess.contains(app)) {
> appsToProcess.add(app);
> }
> }
> FSAppAttempt take() throws InterruptedException {
>   // Reset appBeingProcessed before the blocking call
>   appBeingProcessed = null;
>   // Blocking call to fetch the next starved application
>   FSAppAttempt app = appsToProcess.take();
>   appBeingProcessed = app;
>   return app;
> }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to