-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add some way to clear cache without remounting #6
Comments
Probably handling SIGHUP to dump cache is as close to a convention as we can get. At least it's better then creating some special meaning files. By the way you will probably still have to restart software using ziprofs because it likely doesn't handle file handles becoming invalid well. Software that can handle that also survives ziprofs restart as I can attest from my everyday usage. |
We could close any cached files and refresh handles inside ZipROFS to make this seamless |
The solution I've in my mind is clearing cache and freezing ZipROFS process until underlying FS remounts |
I don't think there is a way for ziprofs to distinguish between empty root and not mounted root. So freeze/unfreeze triggers have to be external, you could use SIGUSR1/2 for that. |
I meant just freezing whole process with |
That works too but then you can't clear cache while the process is frozen. |
I would guess it would process |
Unless this is documented behavior I wouldn't count on it.
I would rather go for more generic solution. Sometimes dumping cache is useful without freezing process, these operations shouldn't be tied together. |
Yes, but it could be function called twice, for |
So this sounds like a plan:
For refreshing file handles I think we will have to try to refresh non-zip handles as well. For that we will need a mapping of ziprofs handles to system handles instead of current odd-even scheme. But I probably won't have time to implement this stuff in a while. |
We could just drop and zipfiles instead of holding next handles. |
First thing that came up to my mind was to open some invisible virtual file in main directory.
eg.
echo "" > ./.clean_ziprofs_cache
Of course
.clean_cache
wouldn't be listed inreaddir()
callAt the moment when I remount underlying filesystem (which was pretty often bcs of bugs in it) I need to remount also ZipROFS and restart all software which was using it.
Some workaroundish way to clean cache and reopen existing handles would be helpful.
The text was updated successfully, but these errors were encountered: