Probable Thread Safety issue with ChannelManager.systemCache

Description

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.

Environment

None

Activity

Show:
Eric Dalquist
October 21, 2009, 2:54 PM

Possible fix for 3.1 or trunk

Eric Dalquist
October 21, 2009, 2:58 PM

The ReferenceMap change was made for uPortal 3.0, prior to 3.0 a thread safe Map implementation was used.

Eric Dalquist
October 21, 2009, 5:01 PM

Fixed by switching to EhCache instance for shared channel rendering cache

Vicky Crowley
March 24, 2010, 7:02 PM

Added uportal-systemChannelCache_3-1-1.patch so that it matches up with the 3.1.1 release.

Fixed

Assignee

Eric Dalquist

Reporter

Andrew Wills

Labels

None

Estimated End Date

None

Fix versions

Priority

Blocker