-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: auto cache clean fail #31931
Comments
That seems surprising. Could you file a separate issue for |
Compiling executables tens of thousands of times with tiny variations is a very unusual mode of usage. It doesn't seem entirely unreasonable to expect you to run That said, if there is some portable way we can detect free space, it might be a good idea for the |
I think this is a dup of #29561. Definitely unfortunate behavior though. I don't think we can put an upper bound on cache size, but we ought to have a smarter eviction policy that takes cache size and free space into account. For reference, the current cache eviction policy is hard-coded in cmd/go/internal/cache. We scan for deletable files at most once per 24 hours. We delete files that haven't been used in 5 days. |
I'm not sure that it is slow. I think the problem is that it had to delete 400gb of smallish files. |
One other sad note, just for posterity. Running |
@josharian That doesn't seem like good behavior either. What should
|
I think that locking scheme is possible to implement using the existing
We don't currently rely on file-locking for the cache, but since this would only prevent a |
I'll file a new issue to discuss, thanks! |
I am in the process of running some toolchain experiments. (Results will probably be sent to golang-dev once it is complete.) This involves compiling executables tens of thousands of times, each time slightly differently.
It turns out that this wreaks havoc on the cache: Every single compilation results in a bunch of new cache entries, which over the course of 24 hours ate my hard drive. (And in the process, caused me to lose my results so far.) I'm several hours into
go cache -clean
. I have 360gb free and counting.GOCACHE=off
is no longer supported.What should I have done (or better, what should cmd/go do) to prevent runaway cache growth? A hard size limit of 100gb for the cache would have saved me a world of trouble.
cc @bcmills @jayconrod
The text was updated successfully, but these errors were encountered: