nixpkgs icon indicating copy to clipboard operation
nixpkgs copied to clipboard

Gitea service: deadlocks boot and nixos-rebuild process when data dir is populated

Open Itaros opened this issue 3 years ago • 0 comments

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:

  1. Attach slow device, like 5400 rpm HDD over slow link(USB attached SCSI, for example, or slow network mount)
  2. Declare gitea service to have data dir on it
stateDir = "/storage/sloooow-device";
  1. nixos-rebuild switch
  2. Mirror completely nixpkgs into gitea instance(git clone --mirror...; git remote set-url...; git push...)
  3. 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

Screenshot 2023-02-06 at 21 49 30

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`

Itaros avatar Feb 06 '23 17:02 Itaros