Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-98

VFS causes deadlocks or is not thread-safe



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Nightly Builds
    • None
    • None
    • jdk1.5.0_07 / Linux


      Newer versions of VFS seems to be unusable in multithreading environments, causing a deadlock of some kind. This causes my Java web server application to completely hang when there is many concurrent connections. My application uses a single FileSystemManager instance, and makes quite heavy use of VFS; opening many files from many threads simultaneously.

      I have tried, without success different workarounds based on some mailing list threads:

      • Using both NullReferenceFilesCache and the default SoftReferenceFilesCache. (SoftReferenceFilesCache seemed to sometimes cause some additional thread-related exceptions under heavy load, but propably unrelated to this issue)
      • Using the new SynchorizedFileObjectDecorator also did not help. On the contrary, it seemed to trigger the deadlock more easily.

      The version I have problems with is a nightly build: commons-vfs-20060831

      The older version commons-vfs-20060115 works beautifully, but I would like to use newer version because I want to be able to use FileObject.refresh() to reset the internal state of files (specially, to get a fresh list of children).

      I hope the threading issues are going to be resolved in near future, and I am willing to help in any way. I do not have very deep experience about multithreading applications, so I wasn't able to get more close to the roots of the issue. Feel free to ask for more information.


        1. vfs_deadlock.txt
          26 kB
          Larry Johnson
        2. vfs.dead.jstack.txt
          44 kB
          Juha-Matti Toppinen
        3. vfs.dead.threaddump.synchronizedfileobject.txt
          12 kB
          Juha-Matti Toppinen
        4. vfs.dead.threaddump.txt
          52 kB
          Juha-Matti Toppinen



            imario Mario Ivankovits
            yaku Juha-Matti Toppinen
            0 Vote for this issue
            4 Start watching this issue