[jira] [Commented] (HADOOP-10501) Server#getHandlers() accesses handlers without synchronization

2014-04-15 Thread Kihwal Lee (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-10501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13969624#comment-13969624
 ] 

Kihwal Lee commented on HADOOP-10501:
-

It's currently only meant for unit tests.  Do you have any other use case in 
mind? 

 Server#getHandlers() accesses handlers without synchronization
 --

 Key: HADOOP-10501
 URL: https://issues.apache.org/jira/browse/HADOOP-10501
 Project: Hadoop Common
  Issue Type: Bug
Reporter: Ted Yu
Priority: Minor

 {code}
   Iterable? extends Thread getHandlers() {
 return Arrays.asList(handlers);
   }
 {code}
 All the other methods accessing handlers are synchronized methods.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HADOOP-10501) Server#getHandlers() accesses handlers without synchronization

2014-04-15 Thread Ted Yu (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-10501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13969659#comment-13969659
 ] 

Ted Yu commented on HADOOP-10501:
-

I did see VisibleForTesting annotation.

Is it expected that tests may see inconsistent Handler array ?

 Server#getHandlers() accesses handlers without synchronization
 --

 Key: HADOOP-10501
 URL: https://issues.apache.org/jira/browse/HADOOP-10501
 Project: Hadoop Common
  Issue Type: Bug
Reporter: Ted Yu
Priority: Minor

 {code}
   Iterable? extends Thread getHandlers() {
 return Arrays.asList(handlers);
   }
 {code}
 All the other methods accessing handlers are synchronized methods.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HADOOP-10501) Server#getHandlers() accesses handlers without synchronization

2014-04-15 Thread Kihwal Lee (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-10501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13969712#comment-13969712
 ] 

Kihwal Lee commented on HADOOP-10501:
-

It should be okay as long as it is called after Server#start(). Adding 
{{synchronized}} won't do much good, but won't hurt either.

 Server#getHandlers() accesses handlers without synchronization
 --

 Key: HADOOP-10501
 URL: https://issues.apache.org/jira/browse/HADOOP-10501
 Project: Hadoop Common
  Issue Type: Bug
Reporter: Ted Yu
Priority: Minor

 {code}
   Iterable? extends Thread getHandlers() {
 return Arrays.asList(handlers);
   }
 {code}
 All the other methods accessing handlers are synchronized methods.



--
This message was sent by Atlassian JIRA
(v6.2#6252)