History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UP-2511
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Eric Dalquist
Reporter: Andrew Wills
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
uPortal

Probable Thread Safety issue with ChannelManager.systemCache

Created: 19/Oct/09 05:35 PM   Updated: 27/Oct/09 12:03 PM
Component/s: Rendering architecture, Framework
Affects Version/s: 2.5.0 GA, 2.5.1 GA, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0, 3.1.1
Fix Version/s: 3.2.0-RC1, 3.1.2, 3.0.5

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File uportal-systemChannelCache.patch (6 kb)



 Description  « Hide
The ChannelManager provides a single, static instance of systemCache (code below), which may be used by every instance of ChannelRenderer.Worker and every rendering thread concurrently.

(Code)
  public static final Map<String, ChannelCacheEntry> systemCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT, SYSTEM_CHANNEL_CACHE_MIN_SIZE, .75f, true);

Unfortunately, ReferenceMap (provided by jakarta commons collections) is no thread-safe. We should either (1) wrap the ReferenceMap in Collections.synchronizedMap(); or (2) replace the ReferenceMap with an EhCache-managed map.

NOTE: This issue only affects channels that are cachable and whose cache keys indicate that SYSTEM-scope is in use.

 All   Comments   Work Log   Change History      Sort Order:
Eric Dalquist [21/Oct/09 09:54 AM]
Possible fix for 3.1 or trunk

Eric Dalquist [21/Oct/09 09:58 AM]
The ReferenceMap change was made for uPortal 3.0, prior to 3.0 a thread safe Map implementation was used.

Eric Dalquist [21/Oct/09 12:01 PM]
Fixed by switching to EhCache instance for shared channel rendering cache