-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
2.2.0.SP1
-
None
TimedCachePolicy should be created with synchronized Map by default. If TimedCachePolicy is created unsynchronized Map, ConcurrentModificationException occurs on TimedCachePolicy.getValidKeys() method.
java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:810) at java.util.HashMap$EntryIterator.next(HashMap.java:851) at java.util.HashMap$EntryIterator.next(HashMap.java:849) at org.jboss.util.TimedCachePolicy.getValidKeys(TimedCachePolicy.java:364) at org.jboss.virtual.plugins.cache.IterableTimedVFSCache.findContext(IterableTimedVFSCache.java:65) at org.jboss.virtual.plugins.cache.CombinedVFSCache.findContext(CombinedVFSCache.java:116) at org.jboss.virtual.plugins.registry.DefaultVFSRegistry.getFile(DefaultVFSRegistry.java:148) at org.jboss.virtual.VFS.getRoot(VFS.java:243) at org.jboss.virtual.VFS.getRoot(VFS.java:313)
When JBoss starts with the default configuration, the following output in boot.log.
21:19:20,173 DEBUG [IterableTimedVFSCache] Creating timed cache policy, lifetime: null, threadSafe: true, resolution: null
This does not mean TimedCachePolicy is threadSafe
protected TimedCachePolicy createCachePolicy() -- snip -- log.debug("Creating timed cache policy, lifetime: " + defaultLifetime + ", threadSafe: " + threadSafe + ", resolution: " + resolution); TimedCachePolicy tcp; if (defaultLifetime == null) tcp = new TimedCachePolicy(); else if (resolution != null) tcp = new TimedCachePolicy(defaultLifetime, threadSafe, resolution); else tcp = new TimedCachePolicy(defaultLifetime); -- snip --
If defaultLifetime and resolution are null, TimedCachePolicy is created using the default constructor. The default constructor is as the following.
public TimedCachePolicy() { this(30*60, false, 0); }
The default constructor specifies threadSafe to false.
- relates to
-
JBPAPP-10372 ConcurrentModificationException occurs on TimedCachePolicy.getValidKeys() method
-
- Closed
-