-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
ref: Clean up empty cache directories #887
Conversation
Thus far, the cleanup process never removed empty cache directories. For one, the worklist based approach cleaning the parent before the children, did not make this possible in the first place, but also because normal operations would have errored out on failing FS operations, for example when a directory or file could not be created in a non-existent directory. This changes the cleanup process to be depth-first, cleaning up empty directories as it goes. It also makes the writing side of things extra defensive and retries FS operations in the unlikely case that a directory is being removed while operating in it.
Codecov ReportBase: 70.27% // Head: 70.05% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #887 +/- ##
==========================================
- Coverage 70.27% 70.05% -0.22%
==========================================
Files 58 58
Lines 11311 11382 +71
==========================================
+ Hits 7949 7974 +25
- Misses 3362 3408 +46
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Thus far, the cleanup process never removed empty cache directories. For one, the worklist based approach cleaning the parent before the children, did not make this possible in the first place, but also because normal operations would have errored out on failing FS operations, for example when a directory or file could not be created in a non-existent directory.
This changes the cleanup process to be depth-first, cleaning up empty directories as it goes. It also makes the writing side of things extra defensive and retries FS operations in the unlikely case that a directory is being removed while operating in it.