Comment 6 for bug 507557

Revision history for this message
Gareth White (gwhite-deactivatedaccount) wrote :

That does sound like a good way to go as it would actually solve two issues (the original bug, plus prematurely deleting obsoleted files).

Would you recommend adding a "packs_to_obsolete" member to this class? That would make it easy for _clear_obsolete_packs() to know which ones to skip deletion of, while at the same time allowing it to remove them from the list so they don't try to be obsoleted twice. An alternative is to try to pass in and return a list via _save_pack_names() but that seems a little messy.

As an aside, I'm a bit unclear why _clear_obsolete_packs() is called from within _save_pack_names(). This does mean that files in "obsolete_packs" are deleted only while pack-names is locked, yet _obsolete_packs() moves files into there while it's not locked. I'm sure there must be a good reason - if not, perhaps we could do the deletions closer to where we obsolete the files. That would make it easier to implement this bugfix.