[mythtv-users] find_orphans.py sort of working, sort of timing out

Raymond Wagner raymond at wagnerrp.com
Mon Mar 5 23:55:47 UTC 2012


find_orphans.py pulls a list of recordings from the database, a list of 
files from each backend, and compares the two.  Any files that don't 
look like they're from a valid recording, it marks as orphaned.  Any 
recording that doesn't have a matching file, it marks as orphaned.  When 
you tell it to delete them, it in turn tells the backend to delete them, 
and then loops back through itself.

Now depending on how many orphans you have to delete, what kind of 
filesystem you are using, and your deletion mode, this could take a 
while.  As is often the case, the backend has only gotten part of the 
way through the list by the time find_orphans.py rescans and picks them 
up again.  If you tell the backend to delete a second time, some of 
those will have been deleted between when you scanned, and when you told 
it to delete.  This is an otherwise harmless race condition, and just 
flushes you back into a newly refreshed list.

find_orphans.py will not do anything automatically, and even requires a 
second confirmation just to make sure you aren't accidentally doing 
something foolish.  1056 orphans is an awful lot, and should be a pretty 
big warning that something is wrong.  Did you recently lose a hard 
drive, or have a corrupt database?  Or are these just a bunch of small 
and empty recordings MythTV has somehow lost track of?  There is an 
issue where the script will inexplicably pick up false positives.  The 
file is there, the database entry is there, but find_orphans.py will 
mark it as an orphan, and a refresh clears them.  I can't find anything 
wrong with the script that would cause this.  The only thing I can think 
of is something going wrong with the communication with the backend, the 
prevents a complete file list from being received.


More information about the mythtv-users mailing list