Wangda Tan commented on YARN-3142:

Thanks [~varun_saxena],

Yes I understand that this will not have any meaningful performance gain, but 
we can optimize it later like adding fine-grained locks. This is first step to 

Generally the patch looks very good, only a few comments:

*Lock is not requred:*

  public Map<String, ResourceRequest> getResourceRequests(
      SchedulerRequestKey schedulerKey) {
      // ...

*Lock is required:*

  public Resource getResource(SchedulerRequestKey schedulerKey) {
    // ... 
(Imaging someone replace the request in another thread before returning)

You may need to synchronize placesBlacklistedByApp and call 
placesBlacklistedByApp.addAll(appInfo.getBlackList()) to make it consistent to 
other blacklist-related operations.

> Improve locks in AppSchedulingInfo
> ----------------------------------
>                 Key: YARN-3142
>                 URL: https://issues.apache.org/jira/browse/YARN-3142
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager, scheduler
>            Reporter: Wangda Tan
>            Assignee: Varun Saxena
>         Attachments: YARN-3142.01.patch

This message was sent by Atlassian JIRA

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