Description
The function GlobalCacheTracker::get_registry_items_to_clean_size_both
is responsible for manual gc cleaning when the --max-download-size
option is specified. When determining what to delete, it scans both the src
and .crate
files.
An issue is that if it deletes a .crate
file without deleting its corresponding src
directory, the src
directory becomes orphaned and unusuable, which results in a waste of disk space. Eventually it will be reclaimed during future cache cleaning. It would be nice if it made sure that the src
gets removed if a .crate
file is removed. However, this might be difficult to implement and not worth the complexity, so I'm not sure if this should be done or not.
This may not happen in practice due to the way sorting works (generally the src
and .crate
should have the same timestamp, and it should sort the src
before the .crate
). If that's the case, then this issue can probably be closed (and remove the TODO comment in the code).