-
Notifications
You must be signed in to change notification settings - Fork 182
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
Cleanup cache dir at mount and exit #620
Cleanup cache dir at mount and exit #620
Conversation
Signed-off-by: Daniel Carl Jones <[email protected]>
} | ||
|
||
/// Create an owned copy of the managed path | ||
pub fn as_path_buf(&self) -> PathBuf { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessary. Can't you do something like .as_path().to_owned()
if required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, but I found we were doing that a few times and it felt more ergonomic to just add the method here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left this in for now. We do use it at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should remove. But not a blocker.
Signed-off-by: Daniel Carl Jones <[email protected]>
… to FuseSession Signed-off-by: Daniel Carl Jones <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of nits. Entirely optional.
@@ -597,6 +601,14 @@ fn mount(args: CliArgs) -> anyhow::Result<FuseSession> { | |||
fuse_config, | |||
&bucket_description, | |||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could just ?
here and simplify the rest
} | ||
|
||
/// Create an owned copy of the managed path | ||
pub fn as_path_buf(&self) -> PathBuf { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should remove. But not a blocker.
Merging as is for now, happy to revisit some nits later. |
Description of change
We want to clean the directory used for caching at mount time and exit time to keep usage of the disk under control, especially since we do not intend to support cache re-use (at least initially).
This change adds a new managed directory type, which will create the directory we expect and deleted it on drop, if
close(mut self)
was not already called. We introduceclose
since the drop implementation did not appear to always be invoked.Relevant issues: #255
Does this change impact existing behavior?
No change to released features. Only impacts caching, currently behind a feature flag.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).