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.