Interrupting the daemon is weird
Describe the bug
nix daemon worker interruptions appear to behave inconsistently.
Before getting an op, it would just terminate, leaving the RemoteStore in a state where it won't try to reconnect. (As separate problem)
If the interruption is discovered during an operation, it is reported the same as any other Error, and with the standard message interrupted by the user, which may or may not be true, and is a bit of a stretch to report it that way.
Steps To Reproduce
Expected behavior
- Report that the daemon stopped, not
interrupted by the user - Reconnect and retry on the client, at least for small operations.
- Off-topic: builds should only be retried if we're sure that the shutdown was an intentional interruption and not a loss of connection, because that could be an OOM kill. We don't want to continually DoS a misconfigured RemoteStore using an unattended bad build. I believe all Nix configurations are misconfigured to be easily DoS-ed by accident. (also a off topic)
nix-env --version output
Additional context
Priorities
Add :+1: to issues you find important.
Under what circumstances would the daemon itself be interrupted? I guess you can manually send a SIGINT to the daemon worker process, but I don't know if we want to go out of our way to handle that transparently on the client side. For long-running processes like hydra-server it would be good to reconnect for subsequent operations, at least.
Under what circumstances would the daemon itself be interrupted?
Just chiming in that on a freshly M3->M4 migrated Mac that originally had nix+nix-darwin installed, I ran into a case where the nix daemon seems to be interrupting itself and claiming I'm doing it. Running nix commands result in strange behavior (instantly after sometimes a few uncached downloads):
mumu@macbook-pro nix % nix-shell -p nix-info --run "nix-info -m"
error: Nix daemon disconnected unexpectedly (maybe it crashed?)
mumu@macbook-pro nix % cat /var/log/nix-daemon.log
accepted connection from pid <unknown>, user mumu
libc++abi: terminating due to uncaught exception of type nix::Interrupted: error: interrupted by the user
I swear I'm not interrupting it.