You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by "Woonsan Ko (JIRA)" <je...@portals.apache.org> on 2007/09/10 13:52:30 UTC

[jira] Commented: (JS2-761) ConcurrentModificationException in FileCache after jetspeed 2.1.2 installation

    [ https://issues.apache.org/jira/browse/JS2-761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526138 ] 

Woonsan Ko commented on JS2-761:
--------------------------------

After inspecting this issue, I came to the following conclusion:
 - The FileCacheScanner#run() method has a problematic synchronization issue.

        // line 402-407 of FileCache.java
        Collection values = Collections.synchronizedCollection(FileCache.this.cache.values());
        synchronized (values)
        {
           for (Iterator it = values.iterator(); it.hasNext(); )
           {
               FileCacheEntry entry = (FileCacheEntry) it.next();
        ...

   It synchronizes the 'values', entry collection of the cache object, but it cannot block entry additions of other threads because it does not synchronize the cache object.
   If the entry collection is modified, then the next() will sometimes throw a ConcurrentModificationException.

By the way, I think we'd better defer fixing this issue to the 2.2 release because of the following reasons:
 - The problem may not be a critical problem in a production system because psml pages don't seem to be frequently added.
 - There's no critical problem even though this exception is logged. It will just scan again later.
 - I don't think it's a good idea that we improve this FileCache class. IMO, we'd better use good caching framework library such EhCache. This change could be bigger than we expect, so let's defer this issue.

> ConcurrentModificationException in FileCache after jetspeed 2.1.2 installation
> ------------------------------------------------------------------------------
>
>                 Key: JS2-761
>                 URL: https://issues.apache.org/jira/browse/JS2-761
>             Project: Jetspeed 2
>          Issue Type: Bug
>          Components: Components Core
>    Affects Versions: 2.1.2
>         Environment: java 1.5, SuSe Linux 10, tomcat 5.5.20
>            Reporter: Vitaly Baranovsky
>
> I've downloaded and installed jetspeed portal. I've created several pages and have looked into jetspeed.log.
> There are some exceptions "org.apache.jetspeed.cache.file.FileCache - FileCache Scanner: Error in iteration...
> java.util.ConcurrentModificationException "
> Stack:
> 2007-07-25 13:56:21,598 [Thread-2] ERROR org.apache.jetspeed.cache.file.FileCache - FileCache Scanner: Error in iteration...
> java.util.ConcurrentModificationException
> 	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
> 	at java.util.HashMap$ValueIterator.next(HashMap.java:871) 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org