hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naganarasimha G R (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-5921) Incorrect synchronization in RMContextImpl#setHAServiceState/getHAServiceState
Date Tue, 29 Nov 2016 09:55:58 GMT

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

Naganarasimha G R commented on YARN-5921:
-----------------------------------------

Hi [~rohithsharma], 
Sorry my bad, i had wrongly committed changes of YARN-5572, with this jira id and title, hence
had to revert and recommit.
Is there are any other better way to handle it (like modify only the commit message using
??"git commit --amend"??) without much impact ? As i was not sure I did revert.

Any way this jira is also ready to be committed (thats where the confusion started :( ) ,
will commit it by end of today !


> Incorrect synchronization in RMContextImpl#setHAServiceState/getHAServiceState
> ------------------------------------------------------------------------------
>
>                 Key: YARN-5921
>                 URL: https://issues.apache.org/jira/browse/YARN-5921
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Varun Saxena
>            Assignee: Varun Saxena
>         Attachments: YARN-5921.01.patch, YARN-5921.02.patch
>
>
> Code in RMContextImpl is as under:
> {code:title=RMContextImpl.java|borderStyle=solid}
>   void setHAServiceState(HAServiceState haServiceState) {
>     synchronized (haServiceState) {
>       this.haServiceState = haServiceState;
>     }
>   }
>   public HAServiceState getHAServiceState() {
>     synchronized (haServiceState) {
>       return haServiceState;
>     }
>   }
> {code}
> As can be seen above, in setHAServiceState, we are synchronizing on the passed haServiceState
instead of haServiceState in RMContextImpl which will not lead to desired effect. This does
not seem to be intentional.
> We can use a RW lock or synchronize on some object here. 



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

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


Mime
View raw message