mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
processGraph(): Don't throw ThreadPoolShutDown if there is an exception
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
(cherry picked from commit a8c69cc907
)
This commit is contained in:
parent
2009cc137a
commit
a1b4bc7292
1 changed files with 10 additions and 2 deletions
|
@ -150,8 +150,16 @@ void processGraph(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto & node : nodes)
|
for (auto & node : nodes) {
|
||||||
|
try {
|
||||||
pool.enqueue(std::bind(worker, std::ref(node)));
|
pool.enqueue(std::bind(worker, std::ref(node)));
|
||||||
|
} catch (ThreadPoolShutDown &) {
|
||||||
|
/* Stop if the thread pool is shutting down. It means a
|
||||||
|
previous work item threw an exception, so process()
|
||||||
|
below will rethrow it. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pool.process();
|
pool.process();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue