nixpkgs
nixpkgs copied to clipboard
Gitea service: deadlocks boot and nixos-rebuild process when data dir is populated
Describe the bug
If gitea instance has data in its data directory then boot process or nixos-rebuild switch will get stuck due to attempt to enumerate the universe inside the data directory.
Steps To Reproduce
Steps to reproduce the behavior:
- Attach slow device, like 5400 rpm HDD over slow link(USB attached SCSI, for example, or slow network mount)
- Declare gitea service to have data dir on it
stateDir = "/storage/sloooow-device";
nixos-rebuild switch- Mirror completely nixpkgs into gitea instance(git clone --mirror...; git remote set-url...; git push...)
- Reboot system(or reconfigure with nixos-rebuild in such a way 'setting up tmpfiles' would trigger). It is now deadlocked on "Create Volatile Files and Directories" or "setting up tmpfiles" and will never finish(will perform IO on drive forever. If this is a RAID1 then it will IO only one leg. Wut?)
Expected behavior
Gitea must operate regardless of data directory size and should not disallow booting the system if toys are getting big
Screenshots

Additional context
Potential culprit(but I am not an expert in systemd): https://github.com/NixOS/nixpkgs/commit/9d251d8b21229c1bc307d87e3258e90bdf0968bb
If it must canonize then it should do it in its own unit and should not break the boot process, I think.
Notify maintainers
@Ma27
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
[root@forge-gitea:/etc/nixos]# nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 5.15.88, NixOS, 22.11 (Raccoon), 22.11.1705.b83e7f5a04a`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.11.1`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`