Uploaded image for project: 'Synapse'
  1. Synapse
  2. SYNAPSE-907

VFSTransportListener locks a folder if a non-matching file is put in to it

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.1
    • 3.0.0
    • Transports
    • I have tried this with a ftp/sftp location

    Description

      Create a VFS proxy, provide a file name pattern and a file uri to listen in. Then put a file with a non-matching file name patter to the mentioned folder. VFSTransportListener locks the folder without checking whether the file pattern matches and this lock is not released. After that even if we put a correct file, it cannot be processed due to the lock.

      Following code segment is the culprit.

      VFSTransportListener#scanFileOrDirectory

      else if (!(!entry.isFileLockingEnabled() || (entry.isFileLockingEnabled()
      && VFSUtils.acquireLock(fsManager, fileObject))) &&
      log.isDebugEnabled())

      { log.debug("Couldn't get the lock for processing the file : " + child.getName()); }

      this passes the wrong fileobject to acquire the lock (this should pass child intead of the fileObject). Even we fix this place, this logic is wrong. We dont need to acquire a lock for a non-matching file.

      I have rectified the logic and I'll provide a patch for this.

      Attachments

        1. SYNAPSE_907.patch
          6 kB
          Amila Maharachchi

        Activity

          People

            hiranya Hiranya Kasub Jayathilaka
            amilam Amila Maharachchi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: