flyingcircusio / batou_ext

A library of batou extensions.
Other
4 stars 1 forks source link

[FC-38258] async cleanup in the symlinkandcleanup component #184

Closed PhilTaken closed 2 months ago

PhilTaken commented 3 months ago

The SymlinkAndCleanup component could previously block the deployment and cause massive amounts of io due to it deleting all matching files immediately. Especially for larger directories it makes more sense to instead move the candidates to a separate directory that is monitored by systemd's tmpfiles rules.

Due to https://github.com/NixOS/nixpkgs/blob/63d37ccd2d178d54e7fb691d7ec76000740ea24a/nixos/modules/system/boot/systemd/tmpfiles.nix#L140 we cannot simply add ulimit rules to the tmpfiles unit hence the draft status.

EDIT: the overriding of upstream-provided services seems possible, needs implementation

PhilTaken commented 3 months ago

I think making it configurable would be better here.

n.b.: using the deployment trash folder for the limits here works, see https://www.man7.org/linux/man-pages/man5/systemd.resource-control.5.html:

The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used.