You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Michael Dietrich (Created) (JIRA)" <de...@myfaces.apache.org> on 2012/01/10 08:16:40 UTC

[jira] [Created] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

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


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

        

[jira] [Resolved] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Leonardo Uribe (Resolved) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3442.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.6
                   2.0.12
         Assignee: Leonardo Uribe

I have changed the affected locations with ConcurrentHashMap and CopyOnWriteArrayList. Thanks to Michael Dietrich 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

        

[jira] [Resolved] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Leonardo Uribe (Resolved) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3442.
-------------------------------------

    Resolution: Fixed
    
> 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

        

[jira] [Resolved] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Leonardo Uribe (Resolved) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3442.
-------------------------------------

    Resolution: Fixed
    
> 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

        

[jira] [Commented] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Krashan Brahmanjara (Commented) (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256287#comment-13256287 ] 

Krashan Brahmanjara commented on MYFACES-3442:
----------------------------------------------

Please apply this patch also for 1.1 and 1.2 branch.
                
> 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

        

[jira] [Commented] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Michael Dietrich (Commented) (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13183910#comment-13183910 ] 

Michael Dietrich commented on MYFACES-3442:
-------------------------------------------

Hi Leonardo,

at first let me thank you for you fast response and support.

We also saw that the Unit Tests were failing, when we changed the HashMap to a ConcurrentHashMap, due to the null values you try to store, to indiciate, that no annotations were found. Synchronizing the complete block is surely a solution to the issue, but if this method is called quite often, it might get a bottleneck, because many session might be ligned up waiting to enter the method. Do you have an idea how often the method is normally called? To get around this synchronisation issue, we were thinking to use a Singleton object and put this into the Map, to indicate not annotations have been found. This surely means more changes, because every check for the null retun value nust be changed to check for this Singleton, but in regards to performance it might be the better solution.

Kind regards,

Michael
                
> 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

        

[jira] [Reopened] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Leonardo Uribe (Reopened) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe reopened MYFACES-3442:
-------------------------------------


It seems ConcurrentHashMap cannot be used because it is required to support null values. So I changed the solution to use a synchronized block over the map. That should do the trick.
                
> 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

        

[jira] [Reopened] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Michael Dietrich (Reopened) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dietrich reopened MYFACES-3442:
---------------------------------------


Hi Leonardo,

sorry for reopening the issue again, but I just downloaded 2.1.6 via SVN and the changes are not contained in there. I can only find them, if I download "current21".  According to the Fix Version/s, it should be contained in 2.0.12 and 2.1.6. Is this a mistake and should it be 2.1.7, or can you downport the chages to 2.1.6?

Thanks and kind regards,

Michael

                
> 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

        

[jira] [Commented] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Leonardo Uribe (Commented) (JIRA)" <de...@myfaces.apache.org>.
    [ 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

        

[jira] [Commented] (MYFACES-3442) Infinite loop when calling ApplicationImpl._handleListenerForAnnotations under heavy load

Posted by "Leonardo Uribe (Commented) (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187070#comment-13187070 ] 

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

Hi Michael

The branch on the svn will be rollback this week (it belongs to a release procedure done in december that does not passed), so you have to check trunk. or 2.0.x branch. A release of 2.0.12/2.1.6 will take some time while I include some cool performance enhancements, so stay tuned.

best regards,

Leonardo
                
> 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