Uploaded image for project: 'MediaPortal 1'
  1. MediaPortal 1
  2. MP1-2118

File existance cache issues

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.2.2
    • 1.2.0
    • MediaPortal 1
    • None

    Description

      1. Incorrect lock when working with _fileLookupCache in RemoveFoldersFromCache(string dir) method in Utils.cs. We lock on this _fileLookupCache object and not on the _fileLookupCacheLock object like everywhere else so at the end, everything it's thread unsafe.

      2. Next problem is more complicated to explain but it has to do with paths and their capitalization. Consider following scenario:

      - Cache monitors c:\videos folder (monitored folders are always converted to lowercase)
      - My Videos asks if c:\VIDEOS\Video1.jpg exists
      - c:\VIDEOS\Video1.jpg gets added to cache with exists property set to false (note the capitalization)
      - ...time passes
      - c:\VIDEOS\Video1.jpg actually gets created (thumbnail is created for example)
      - FSW (file system watcher) gets event that c:\videos\Video1.jpg was created (note the capitalization of the folder, monitored folders are always lowercase)
      - now c:\videos\Video1.jpg is added to cache with exists property set to true (this is added as separate cache entry because dictionary key - file name - is case sensitive)
      - ... more time passes
      - My Videos asks if c:\VIDEOS\Video1.jpg exists (again)
      - c:\VIDEOS\Video1.jpg is in cache with exists = false (but the file exists!)

      Attachments

        Activity

          People

            SilentException Mitja Skuver (Inactive)
            SilentException Mitja Skuver (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: