Skip to content

Use WAL mode for SQLite cache databases (2nd attempt)#167

Merged
edolstra merged 3 commits intomainfrom
concurrent-eval-cache
Aug 7, 2025
Merged

Use WAL mode for SQLite cache databases (2nd attempt)#167
edolstra merged 3 commits intomainfrom
concurrent-eval-cache

Conversation

@edolstra
Copy link
Collaborator

@edolstra edolstra commented Aug 1, 2025

Motivation

See #150, which was reverted in #155.

This time, we update the versions of the SQLite caches. This avoids problems with older versions of Nix that don't put the caches in WAL mode. That's generally not a problem, until you do something like

nix build --print-out-paths ... | cachix

which deadlocks because cachix tries to switch the caches to truncate mode, which requires exclusive access. But the first process cannot make progress because the cachix process isn't reading from the pipe.

Context

This avoids problems with older versions of Nix that don't put the
caches in WAL mode. That's generally not a problem, until you do something like

  nix build --print-out-paths ... | cachix

which deadlocks because cachix tries to switch the caches to truncate
mode, which requires exclusive access. But the first process cannot
make progress because the cachix process isn't reading from the pipe.
@github-actions
Copy link

github-actions bot commented Aug 1, 2025

@github-actions github-actions bot temporarily deployed to pull request August 1, 2025 14:53 Inactive
@cole-h cole-h closed this Aug 1, 2025
@cole-h cole-h reopened this Aug 1, 2025
@github-actions github-actions bot temporarily deployed to pull request August 1, 2025 15:15 Inactive
@cole-h cole-h requested a review from colemickens August 4, 2025 16:11
@github-actions github-actions bot temporarily deployed to pull request August 5, 2025 15:16 Inactive
Copy link
Member

@colemickens colemickens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been running this for a bit, seems to be working fine.

@edolstra edolstra added this pull request to the merge queue Aug 7, 2025
Merged via the queue into main with commit a8152eb Aug 7, 2025
33 checks passed
@edolstra edolstra deleted the concurrent-eval-cache branch August 7, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants