You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Karthik Kambatla (JIRA)" <ji...@apache.org> on 2012/10/05 09:58:47 UTC

[jira] [Created] (MAPREDUCE-4707) FairScheduler#dump()'s body is unnecessarily synchronized on eventLog

Karthik Kambatla created MAPREDUCE-4707:
-------------------------------------------

             Summary: FairScheduler#dump()'s body is unnecessarily synchronized on eventLog
                 Key: MAPREDUCE-4707
                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
             Project: Hadoop Map/Reduce
          Issue Type: Improvement
          Components: contrib/fair-share
    Affects Versions: 1.0.3
            Reporter: Karthik Kambatla
            Assignee: Karthik Kambatla


FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MAPREDUCE-4707) Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog

Posted by "Karthik Kambatla (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-4707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik Kambatla updated MAPREDUCE-4707:
----------------------------------------

    Summary: Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog  (was: FairScheduler#dump()'s body is unnecessarily synchronized on eventLog)
    
> Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog
> ------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4707
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: contrib/fair-share
>    Affects Versions: 1.0.3
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>         Attachments: MR-4707.patch
>
>
> FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MAPREDUCE-4707) Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAPREDUCE-4707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470556#comment-13470556 ] 

Hadoop QA commented on MAPREDUCE-4707:
--------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12548017/MR-4707.patch
  against trunk revision .

    {color:red}-1 patch{color}.  The patch command could not apply the patch.

Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2908//console

This message is automatically generated.
                
> Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog
> ------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4707
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: contrib/fair-share
>    Affects Versions: 1.0.3
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>            Priority: Trivial
>         Attachments: MR-4707.patch, MR-4707.patch
>
>
> FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MAPREDUCE-4707) Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog

Posted by "Karthik Kambatla (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-4707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik Kambatla updated MAPREDUCE-4707:
----------------------------------------

    Attachment: MR-4707.patch

Thanks Todd for pointing it out. I am uploading a patch that clears for anyone else looking at it.
                
> Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog
> ------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4707
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: contrib/fair-share
>    Affects Versions: 1.0.3
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>         Attachments: MR-4707.patch, MR-4707.patch
>
>
> FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MAPREDUCE-4707) FairScheduler#dump()'s body is unnecessarily synchronized on eventLog

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAPREDUCE-4707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470432#comment-13470432 ] 

Todd Lipcon commented on MAPREDUCE-4707:
----------------------------------------

Looks like FairSchedulerEventLog.log(...) is itself synchronized, so synchronizing on eventLog prevents the dump from getting interleaved with other messages to the log
                
> FairScheduler#dump()'s body is unnecessarily synchronized on eventLog
> ---------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4707
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: contrib/fair-share
>    Affects Versions: 1.0.3
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>         Attachments: MR-4707.patch
>
>
> FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MAPREDUCE-4707) FairScheduler#dump()'s body is unnecessarily synchronized on eventLog

Posted by "Karthik Kambatla (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-4707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik Kambatla updated MAPREDUCE-4707:
----------------------------------------

    Attachment: MR-4707.patch

Uploading a patch that removes the synchonization on eventLog in FairScheduler#dump(). However, this patch requires MR-4706 commmitted - they modify the same method.
                
> FairScheduler#dump()'s body is unnecessarily synchronized on eventLog
> ---------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4707
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: contrib/fair-share
>    Affects Versions: 1.0.3
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>         Attachments: MR-4707.patch
>
>
> FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MAPREDUCE-4707) Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog

Posted by "Karthik Kambatla (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-4707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik Kambatla updated MAPREDUCE-4707:
----------------------------------------

    Status: Patch Available  (was: Open)

The patch doesn't have any tests as it is just adding a comment.
                
> Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog
> ------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4707
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: contrib/fair-share
>    Affects Versions: 1.0.3
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>         Attachments: MR-4707.patch, MR-4707.patch
>
>
> FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MAPREDUCE-4707) Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog

Posted by "Karthik Kambatla (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-4707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik Kambatla updated MAPREDUCE-4707:
----------------------------------------

    Priority: Trivial  (was: Major)
    
> Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog
> ------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4707
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: contrib/fair-share
>    Affects Versions: 1.0.3
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>            Priority: Trivial
>         Attachments: MR-4707.patch, MR-4707.patch
>
>
> FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MAPREDUCE-4707) Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog

Posted by "Karthik Kambatla (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAPREDUCE-4707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470565#comment-13470565 ] 

Karthik Kambatla commented on MAPREDUCE-4707:
---------------------------------------------

That said, wouldn't it be simpler to buffer all the dump log messages, and log them at once? That way, other non-synchronized methods in FS wouldn't need to wait for dump to go through all the jobs/pools.
                
> Add a comment to explain why FairScheduler#dump()'s body is synchronized on eventLog
> ------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4707
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4707
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: contrib/fair-share
>    Affects Versions: 1.0.3
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>            Priority: Trivial
>         Attachments: MR-4707.patch, MR-4707.patch
>
>
> FairScheduler#dump() is a synchronized method. In addition to that, the entire method body is in a synchronized block on eventLog. However, there is no other portion of the code that tries to acquire a lock on eventLog. So, it seems like the second synchronized block is redundant, and can be removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira