Zombie resume points and other issues with the file resume cache

Issue #361 resolved
prl created an issue

There are a number of oddities with the resume cache management (InfoBarGenerics.setResumePoint(), delResumePoint(), resumePointCacheLast).

  • If the mount point name of a file pointed to by a resume point in the cache is changed, the resume point will never be deleted (unless the user does a USB update and doesn't restore settings).
  • The code looks (very) superficially like an LRU cache, but all that happens is that whenever a new resume point is added, the resume points are deleted for all files that are no longer at their original path name (moved or deleted), provided the the files are mounted.
  • delRemovePoint() saves the resume points unnecessarily if its unable to delete a resume point from the in-memory cache.
  • Variable resumePointCacheLast appears to be write-only.

Comments (2)

  1. Peter Urbanec

    I don't think the first two observations are entirely correct. Any resume point that is pointing to an inaccessible path will be deleted when a new resume point is created. The code had what superficially looked like a mount point check, but that code was misleading and would always evaluate to True.

    However, I completely agree that this code needs attention. I have started on some parts of it, but it needs a lot more work. In particular, the path validity check (and probably saving cache to persistent storage) needs to be asynchronous.

  2. Log in to comment