eclipse-ee4j / mojarra

Mojarra, a Jakarta Faces implementation
Other
162 stars 110 forks source link

No resource caching at all due to MultiKeyConcurrentHashMap bug #2930

Closed ren-zhijun-oracle closed 11 years ago

ren-zhijun-oracle commented 11 years ago

ResourceManager uses MultiKeyConcurrentHashMap inside to cache ResourceInfo. Many times it fills key4 with a Collections.emptyList() (when viewroot is available but there are no con parameter in the incoming request as much as I understand).

When key4 is not null MultiKeyConcurrentHashMap does not work well. Reason is in MultiKeyConcurrentHashMap$Segment.get() function:

if ((e.hash == hash && key1.equals(e.key1)) && ((key2 == null && e.key2 == null) || (key2 != null && key2.equals(e.key2))) && ((key3 == null && e.key3 == null) || (key3 != null && key3.equals(e.key3))) && ((key4 == null && e.key4 == null) || (key4 != null && key4.equals(e.key2))))

In this if statement key4 is checked against e.key2 instead of e.key4. We call this CopyPasteException .

If you could please fix this till the next version as it takes only a couple of minutes but without the fix we cannot use it in live system (as a page rendering is very slow).

Affected Versions

[2.2.0]

ren-zhijun-oracle commented 6 years ago
ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented Reported by zsb

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented @manfredriem said: Resetting priority pending triage

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented @manfredriem said: Applied to 2.1 branch,

svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-2926, r=rogerk, make sure the MultiKeyConcurrentHashMap compares the passed in keys correctly" Sending jsf-ri\src\main\java\com\sun\faces\util\MultiKeyConcurrentHashMap.java Transmitting file data . Committed revision 12085.

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented @manfredriem said: Applied to 2.2 branch,

svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-2926, r=rogerk, make sure the MultiKeyConcurrentHashMap compares the passed in keys correctly" Sending jsf-ri\src\main\java\com\sun\faces\util\MultiKeyConcurrentHashMap.java Transmitting file data . Committed revision 12087.

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented File: changebundle.txt Attached By: @manfredriem

ren-zhijun-oracle commented 7 years ago

@javaserverfaces Commented This issue was imported from java.net JIRA JAVASERVERFACES-2926

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented Marked as fixed on Thursday, July 11th 2013, 8:32:53 am