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

Leonardo Uribe commented on MYFACES-3442:
-----------------------------------------

Hi Michael

Really it should be similar to 
javax.faces.component._ComponentAttributesMap.getPropertyDescriptor() . Note 
the synchronized block is only to wrap the code that adds a value on the map, 
and the map is application scope, so once the first requests has been 
processed, the map will be full and no contention will occur anymore. 

Anyway, it sounds good to use a Singleton object like a empty list 
(Collections.emptyList()). I have already committed the solution. I hope this 
change will solve the problem. Thanks for the suggestion.
                
> Infinite loop when calling ApplicationImpl._handleListenerForAnnotations 
> under heavy load
> -----------------------------------------------------------------------------------------
>
>                 Key: MYFACES-3442
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3442
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Michael Dietrich
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.12, 2.1.6
>
>
> Hi,
> when doing Load Tests, we  recognize that we sometimes got stuck in an 
> infinite loop, when calling the _handleListenerForAnnotations method of the 
> ApplicationImpl class. According to our analysis, this is related to the 
> _classToListenerForMap attribute that is is defined as plain HashMap, so no 
> synchronisation takes place when it is accessed from several threads. Our 
> suggestion would be, to define it as a ConcurrentHashMap instead, because 
> according to our experience, such kind of infinite loops due to concurrency 
> don't occur with ConcurrentHashMaps.
> Kind regards,
> Michael

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to