decide and document that stuff in the CacheDirectory can be deleted while Tor is running
As of #24272 (moved) and #22703 (moved) we have a separate CacheDirectory that Tor can use to put transient things like cached directory info.
_hc asked just now if it's ok to put the CacheDirectory, for Tor on Android, in a place where it might get blown away periodically.
On #24272 (moved) I see an example value being "/var/cache/".
And on https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s05.html it says that for /var/cache/, "The application must always be able to recover from manual deletion of these files (generally because of a disk space shortage)."
So I think the answer is yes, we should support having the files in CacheDirectory disappear out from under us.
So:
-
Step zero is to decide that this is what we want.
-
Step one is to learn whether Tor breaks currently in this situation. Like, we mmap some of those files. If they get deleted, does everything go smoothly? (For some Linux filesystems, the file can be deleted but Tor will still hold its copy in existence until it gives up the file descriptor, which would seem helpful in this situation. But I bet not all OSes and FSes work that way.)
-
And step two would be to change the man page to say what we do or don't promise here.