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

Threading issue with AbstractFileSystem.fireEvent

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      I make heavy use of DelegateFileObject in my code and recently ran into a threading issue when a change in one file was trying to automatically update dependent DelegateFileObjects. While events where still being propagated, one DelegateFileObject removed itself as an event listener. This caused an index-of-range problem in AbstractFileSystem.fireEvent because the listener list had shrunk, but the "count" had already been fixed.

      It appears that the current implementation of fireEvent is not entirely thread safe, if event handlers can still change the listener list in place. I will attach a patch that works for me.

        Attachments

          Activity

            People

            • Assignee:
              imario Mario Ivankovits
              Reporter:
              digi Chris DiGiano
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: