1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-05 20:41:47 +02:00

Merge pull request #12294 from DeterminateSystems/fix-thread-pool-error

processGraph(): Don't throw ThreadPoolShutDown if there is an exception
This commit is contained in:
Robert Hensing 2025-01-20 16:23:32 +01:00 committed by GitHub
commit dccabc8f84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,8 +150,16 @@ void processGraph(
} }
}; };
for (auto & node : nodes) for (auto & node : nodes) {
pool.enqueue(std::bind(worker, std::ref(node))); try {
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();