You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug that matches the one I want to file, without success.
If this is an issue with a particular app, I have tried filing it in the appropriate issue tracker for the app (e.g. under https://github.com/flathub/) and determined that it is an issue with Flatpak itself.
This issue is not a report of a security vulnerability (see here if you need to report a security issue).
Flatpak version
1.15.4
What Linux distribution are you using?
Arch Linux
Linux distribution version
rolling
What architecture are you using?
x86_64
How to reproduce
Use flatpak for more than 30 days.
Observe /var/tmp/flatpak-cache-* directories not being cleaned up by the systemd-tmpfiles rule, even though most of them are empty.
Expected Behavior
I expect that /var/tmp/flatpak-cache-* directories do not accumulate indefinitely and are garbage collected eventually.
Actual Behavior
I have a few dozens of stale and empty /var/tmp/flatpak-cache-* directories that are no longer used, but are not garbage collected:
...
drwxr-xr-x 1 max max 0 Sep 10 2022 flatpak-cache-RTU1R1
drwxr-xr-x 1 max max 0 Feb 9 12:02 flatpak-cache-SQN5Z1
drwxr-xr-x 1 max max 0 Nov 26 17:58 flatpak-cache-T5YIT1
...
Additional Information
Running SYSTEMD_LOG_LEVEL=7 systemd-tmpfiles --clean revealed the reason why these unused directories don't get garbage collected: it's because the access time (atime) of each directory is updated regularly, supposedly, by flatpak itself:
...
Directory "/var/tmp/flatpak-cache-RTU1R1": access time Thu 2023-04-06 01:16:53.247647 EEST is too new.
Directory "/var/tmp/flatpak-cache-977DS1": access time Thu 2023-04-06 01:16:53.247647 EEST is too new.
Directory "/var/tmp/flatpak-cache-OYDWR1": access time Thu 2023-04-06 01:16:53.247647 EEST is too new.
...
The atimes of all flatpak-cache directories are within one second, so I suppose flatpak goes over all of them, updating atimes, when it performs some action.
Possible ways to solve it:
Flatpak could stop iterating and bumping atimes of flatpak-cache directories that are no longer in use. This way, systemd-tmpfiles could garbage collect them.
Alternatively, if the previous way is not possible for some reason, flatpak could ship with a tmpfiles config that tells systemd to ignore atimes on flatpak-cache directories, something like this, not tested yet:
e /var/tmp/flatpak-cache-* - - - 30d:abcmBM
The text was updated successfully, but these errors were encountered:
Could this be related to #1119? Interestingly, problems with the cache seem to be correlated with the Arch Linux distribution. Interestingly, e.g. Fedora doesn't seem to do any tmp-related magic when creating the package - see https://src.fedoraproject.org/rpms/flatpak/blob/f38/f/flatpak.spec
Checklist
Flatpak version
1.15.4
What Linux distribution are you using?
Arch Linux
Linux distribution version
rolling
What architecture are you using?
x86_64
How to reproduce
Expected Behavior
I expect that /var/tmp/flatpak-cache-* directories do not accumulate indefinitely and are garbage collected eventually.
Actual Behavior
I have a few dozens of stale and empty /var/tmp/flatpak-cache-* directories that are no longer used, but are not garbage collected:
Additional Information
Running
SYSTEMD_LOG_LEVEL=7 systemd-tmpfiles --clean
revealed the reason why these unused directories don't get garbage collected: it's because the access time (atime) of each directory is updated regularly, supposedly, by flatpak itself:The atimes of all flatpak-cache directories are within one second, so I suppose flatpak goes over all of them, updating atimes, when it performs some action.
Possible ways to solve it:
The text was updated successfully, but these errors were encountered: