openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

laikad: don't write cache to disk

Open adeebshihadeh opened this issue 2 years ago • 3 comments

Laikad caches file to disk but doesn't clean up after itself. This happens to be mostly ok right now because it writes to a tmpfs which doesn't persist across boots. Laika should provide provide a function that returns whether a given file is relevant.

adeebshihadeh avatar Aug 24 '22 00:08 adeebshihadeh

Do you mean the files downloaded in Laika or the parsed orbits/nav data cached in Laikad? The latter is overwritten when new files arrive so that shouldn't be a problem. I think all files downloaded in Laika can be removed safely after 48 hours. (I think the prediction files contain data not longer than 48 hours). And most could actually be removed directly after being parsed since Laikad has its own cache. (except for the .attempt files to avoid many download requests)

gijskoning avatar Aug 29 '22 09:08 gijskoning

@gast04 I think what we want to do here is refactor laika to not write to disk at all in our case, but it doesn't seem like that refactor will make it for 0.9.1. What do you think about just periodically cleaning the cache in laikad? Do we ever read it?

adeebshihadeh avatar Feb 03 '23 05:02 adeebshihadeh

Ah, I see we're always running in no internet mode. Removing from the milestone.

adeebshihadeh avatar Feb 03 '23 20:02 adeebshihadeh

Irrelevant until internet is enabled.

haraschax avatar May 23 '23 16:05 haraschax