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

Sunil G commented on YARN-5802:
-------------------------------

HI [~bibinchundatt] for the patch.

Extremely sorry for confusing earlier with the comment of introducing 
{{contains}} interface. I have looked into {{LQ#removeApplicationAttempt}}. And 
it uses like below. And it is similar to the approach you have told first 
offline.

{code}
      boolean wasActive = orderingPolicy.removeSchedulableEntity(application);
      if (!wasActive) {
        pendingOrderingPolicy.removeSchedulableEntity(application);
      }
{code}

So could we do something like below which i think matches your initial 
impression.
{code}
      boolean wasActive = orderingPolicy.removeSchedulableEntity(application);
      if (!wasActive) {
        pendingOrderingPolicy.removeSchedulableEntity(application);
      }
      // Update new priority in SchedulerApplication
      attempt.setPriority(newAppPriority);

      if (wasActive) {
        getOrderingPolicy().addSchedulableEntity(attempt);
      } else {
        getPendingAppsOrderingPolicy().addSchedulableEntity(attempt);
      }
{code}

TestCase:
 1. Could we move {{testUpdatePriorityAndRemoveAttempt}} to 
{{TestApplicationPriority}}
 2. I think currently in {{testUpdatePriorityAndRemoveAttempt}} (as per patch), 
second priority update is not happening. 
So could we remove the kill part, and call {{cs.updateApplicationPriority}}  
direct so that update priority will be done for pending app (assuming no node 
is registered).  Then register a new node, and ensure that this app is moved to 
{{oderingPolicy}} which is the active list. With this, we can now complete full 
test case. It will really great if we can have such a case in 
{{TestApplicationPriority}}

Thanks.

> Application priority updates add pending apps to running ordering policy
> ------------------------------------------------------------------------
>
>                 Key: YARN-5802
>                 URL: https://issues.apache.org/jira/browse/YARN-5802
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Bibin A Chundatt
>            Assignee: Bibin A Chundatt
>            Priority: Critical
>         Attachments: YARN-5802.0001.patch, YARN-5802.0002.patch, 
> YARN-5802.0003.patch, YARN-5802.0004.patch
>
>
> {{LeafQueue#updateApplicationPriority}}
> {code}
>  getOrderingPolicy().removeSchedulableEntity(attempt);
>       // Update new priority in SchedulerApplication
>       attempt.setPriority(newAppPriority);
>       getOrderingPolicy().addSchedulableEntity(attempt);
> {code}
> We should add again to ordering policy only when  attempt available in first 
> case.Else during application attempt removal will try to iterate on killed 
> application still available in pending Ordering policy.Which can cause RM to 
> crash.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to