0003730: File existance cache issues (1 Viewer)

MediaPortal-Bot

Worlds greatest bot!
March 26, 2007
3,715
180
Home Country
Germany Germany
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!)

http://mantis.team-mediaportal.com/view.php?id=3730

Open the issue in Mantis...
 

Users who are viewing this thread

Top Bottom