commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raman Gupta (JIRA)" <j...@apache.org>
Subject [jira] Updated: (VFS-122) [vfs] Synchronization issue in SoftRefFilesCache
Date Fri, 09 Nov 2007 21:13:50 GMT

     [ https://issues.apache.org/jira/browse/VFS-122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Raman Gupta updated VFS-122:
----------------------------

    Attachment: commons-vfs-synchronized_map.patch

Patch to fix this bug. Has been working fine in production now for several weeks.

> [vfs] Synchronization issue in SoftRefFilesCache
> ------------------------------------------------
>
>                 Key: VFS-122
>                 URL: https://issues.apache.org/jira/browse/VFS-122
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: Sun Solaris, JDK 1.5.0_08
>            Reporter: Raman Gupta
>         Attachments: commons-vfs-synchronized_map.patch
>
>
> I am using Commons VFS 1.0 RC8, and I believe I have found a
> synchronization problem in SoftRefFilesCache.java. My system
> occasionally exhibits high CPU usage in a thread with the stack shown
> below [1]. The problem method is a HashMap.put at line 155 -- though I
> think the line number is actually 156, since 155 is a TreeMap.put.
> Access to the refReverseMap is not synchronized (nor is the map itself
> synchronized) which I believe is the problem. On multi-cpu machines,
> this can cause race conditions in HashMap.
> [1] Thread stack:
> "Thread-28" prio=10 tid=0x00f56090 nid=0x34 runnable
> [0xa787d000..0xa787f8f0]
>         at java.util.HashMap.put(HashMap.java:420)
>         at org.apache.commons.vfs.cache.SoftRefFilesCache.putFile(SoftRefFilesCache.java:155)
>         - locked <0xb7a09558> (a java.util.TreeMap)
>         at org.apache.commons.vfs.provider.AbstractFileSystem.putFileToCache(AbstractFileSystem.java:163)
>         at org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:306)
>         - locked <0xb791bfe8> (a org.apache.commons.vfs.provider.local.LocalFileSystem)
>         at org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:264)
>         - locked <0xb791bfe8> (a org.apache.commons.vfs.provider.local.LocalFileSystem)
>         at org.apache.commons.vfs.provider.AbstractFileSystem.getRoot(AbstractFileSystem.java:239)
>         at org.apache.commons.vfs.provider.AbstractFileObject.getParent(AbstractFileObject.java:485)
>         at org.apache.commons.vfs.provider.AbstractFileObject.isWriteable(AbstractFileObject.java:466)
>         at org.apache.commons.vfs.provider.AbstractFileObject.getOutputStream(AbstractFileObject.java:1148)
>         at org.apache.commons.vfs.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:367)
>         at org.apache.commons.vfs.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:350)
>         [...]

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


Mime
View raw message