Skip to content

Conversation

@zimbatm
Copy link
Member

@zimbatm zimbatm commented Dec 12, 2025

Motivation

This change modifies the behaviour of Nix to always communicate with the
daemon, even if the store is writable to that user.

Bypassing the daemon had a number of issues. Mainly, the client
behaviour is not always consistent between users leading to confusion.
The max-jobs counter is not shared between various instances of the Nix
client. The clients fight between each-other to hold the lock on the
sqlite database.

By making the access consistent, it opens the road for the daemon to
permanently hold the lock on the sqlite database, and get rid of the
"sqlite is busy" type of errors.

Reviving this after 5 years. See #4263

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

This change modifies the behaviour of Nix to always communicate with the
daemon, even if the store is writable to that user.

Bypassing the daemon had a number of issues. Mainly, the client
behaviour is not always consistent between users leading to confusion.
The max-jobs counter is not shared between various instances of the Nix
client. The clients fight between each-other to hold the lock on the
sqlite database.

By making the access consistent, it opens the road for the daemon to
permanently hold the lock on the sqlite database, and get rid of the
\"sqlite is busy\" type of errors.
@github-actions github-actions bot added documentation store Issues and pull requests concerning the Nix store labels Dec 12, 2025
@edolstra
Copy link
Member

Bypassing the daemon had a number of issues.

But this PR doesn't fix any of those issues. max-jobs is still per daemon worker process, as are the SQLite locks. Fixing that would probably require making the daemon multithreaded rather than multi-process, which is not entirely trivial.

Forcing the use of the daemon just adds unnecessary overhead when (for instance) you're running Nix builds as root in a container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants