Hi,
 
> A patch was applied, so the solution is included in 1.1.7 and 1.2.7.
It could be good to have confirmation that solution solves the problem
(I haven't close that one yet by that reason).

I reviewed the issue and the patch. I am sorry I can neither say
definitly yes nor no. Why?

It is a race condition - we validated from code review and in running
system that our solution solves the problem at hand

The "but" is: I solved it using a synchronized block around the whole
method body and can't make sure that there are no new problems
introduced with volatile. And there's no guarantee for other code parts
bearing the same pattern. 

The advantage is the blocking of synchronized (what volatile does not),
thus computing the collection's content will be done only once and not
multiple times in case of concurrent usage.

Please feel free to take this as a "yes, it solves the problem" in my
opinion. I think you might close your issue.

Best regards,
Matthias
 


________________________________

From: Leonardo Uribe [mailto:[email protected]] 
Sent: Monday, August 17, 2009 10:18 AM
To: MyFaces Development
Subject: Re: Concurrency problems in Myfaces 1.1.5




2009/8/17 <[email protected]>


        Hello,
        
        We found a NullPointerException occuring in
        JspViewHandlerImpl.getServletMappings().
        It could be traced back to an implementation problem in method
        
org.apache.myfaces.shared_impl.webapp.webxml.WebXML.getServletMappings()
        .
        
        This method is used as singleton. When called simultaneously
from
        different requests, the result collection saved as member
variable
        remains in inconsistent state and contains some unexpected null
entries
        causing the NPE in JspViewHandlerImpl.
        
        We produced that error with a frameset having 2 frames using JSF
pages,
        but the frameset definition itself not.
        It might probably come under different circumstances too.
        
        Our simplest solution was to synchronize the whole block of the
method
        altough more efficient ways shall be possible.
        Please note that other methods (e.g.
getFacesExtensionsFilterMappings())
        of this and similar classes will lack the same problem.
        
        Sorry if you already have fixed this in later versions of
MyFaces (we
        ourself can not upgrade yet).
        


Hi

I remember that one. Take a look at this one:

http://issues.apache.org/jira/browse/MYFACES-2165

A patch was applied, so the solution is included in 1.1.7 and 1.2.7. It
could be good to have confirmation that solution solves the problem (I
haven't close that one yet by that reason).

regards

Leonardo Uribe
 


        Thank you for your notice.
        
        Cheers, Matthias.
        


Reply via email to