Skip to content

Conversation

@edolstra
Copy link
Member

Motivation

Fixes

$ nix copy --derivation --to /tmp/nix /nix/store/...
error: cannot enqueue a work item while the thread pool is shutting down

The ThreadPoolShutDown exception was hiding the reason for the thread pool shut down, e.g.

error: cannot add path '/nix/store/03sl46khd8gmjpsad7223m32ma965vy9-fix-static.patch' because it lacks a signature by a trusted key

Context


Add 👍 to pull requests you find important.

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

Fixes

  $ nix copy --derivation --to /tmp/nix /nix/store/...
  error: cannot enqueue a work item while the thread pool is shutting down

The ThreadPoolShutDown exception was hiding the reason for the thread
pool shut down, e.g.

  error: cannot add path '/nix/store/03sl46khd8gmjpsad7223m32ma965vy9-fix-static.patch' because it lacks a signature by a trusted key
Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

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

A valid solution for an instance of the problem.

We'll have more instances of this. Perhaps enqueue should always succeed, and it could return a promise from which the exception could be read.

Alternatively, we could migrate to a standard pool implementation, if possible.

@roberth roberth merged commit dccabc8 into NixOS:master Jan 20, 2025
12 checks passed
@roberth roberth added automatic backport This PR is a backport produced by automation (does not trigger backporting) and removed automatic backport This PR is a backport produced by automation (does not trigger backporting) labels Jan 20, 2025
edolstra added a commit that referenced this pull request Jan 20, 2025
…2294

processGraph(): Don't throw ThreadPoolShutDown if there is an exception (backport #12294)
edolstra added a commit that referenced this pull request Jan 20, 2025
…2294

processGraph(): Don't throw ThreadPoolShutDown if there is an exception (backport #12294)
@roberth roberth added the backports created Does not require attention and can be filtered away label Jan 20, 2025
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-01-20-nix-team-meeting-minutes-209/59119/1

@grahamc grahamc deleted the fix-thread-pool-error branch April 27, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backports created Does not require attention and can be filtered away

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants