You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Simon Kitching (JIRA)" <de...@myfaces.apache.org> on 2007/03/28 04:54:32 UTC

[jira] Created: (MYFACES-1578) WebXml class has thread-safety issue (AddResourceFactory reports ExtensionFilter not mapped)

WebXml class has thread-safety issue (AddResourceFactory reports ExtensionFilter not mapped)
--------------------------------------------------------------------------------------------

                 Key: MYFACES-1578
                 URL: https://issues.apache.org/jira/browse/MYFACES-1578
             Project: MyFaces Core
          Issue Type: Bug
            Reporter: Simon Kitching


In trunk of shared module, class o.a.m.shared.webapp.webxml.WebXml is a singleton (instance placed in the application map) but it does not synchronize access to its members.

For example, when the object is first created and stored into the application map on startup, member _facesExtensionsFilterMappings is null. When a later call comes in to method getFacesExtensionsFilterMappings() on the singleton instance and it is discovered that the value is null a new array is created and populated. However this method does not protect against race condtions in any way, so two requests that pass through the ExtensionsFilter can be executing this code concurrently, with potentially nasty effects.

We have a load test that is actually experiencing intermittent exceptions when run against a freshly-started webapp. The exception is actually in AddResourceFactory.checkEnvironment, where it complains that there is no mapping for the ExtensionFilter, and the thread-race above could well be the cause.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-1578) WebXml class has thread-safety issue (AddResourceFactory reports ExtensionFilter not mapped)

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

Leonardo Uribe commented on MYFACES-1578:
-----------------------------------------

Checking this bug I have found that the conditions (WebXml as singleton and synchronized method) was solved.

Actually, the WebXml instance is placed in the application map and there is a code that handle thread problem in AddResourceFactory.checkEnvironment.

Since the only part where this method is called is in tomahawk, this issue should be closed.

> WebXml class has thread-safety issue (AddResourceFactory reports ExtensionFilter not mapped)
> --------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-1578
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1578
>             Project: MyFaces Core
>          Issue Type: Bug
>            Reporter: Simon Kitching
>            Assignee: Leonardo Uribe
>
> In trunk of shared module, class o.a.m.shared.webapp.webxml.WebXml is a singleton (instance placed in the application map) but it does not synchronize access to its members.
> For example, when the object is first created and stored into the application map on startup, member _facesExtensionsFilterMappings is null. When a later call comes in to method getFacesExtensionsFilterMappings() on the singleton instance and it is discovered that the value is null a new array is created and populated. However this method does not protect against race condtions in any way, so two requests that pass through the ExtensionsFilter can be executing this code concurrently, with potentially nasty effects.
> We have a load test that is actually experiencing intermittent exceptions when run against a freshly-started webapp. The exception is actually in AddResourceFactory.checkEnvironment, where it complains that there is no mapping for the ExtensionFilter, and the thread-race above could well be the cause.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.