1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

Merge pull request #12308 from NixOS/mergify/bp/2.25-maintenance/pr-12294

processGraph(): Don't throw ThreadPoolShutDown if there is an exception (backport #12294)
This commit is contained in:
Eelco Dolstra 2025-01-20 17:19:12 +01:00 committed by GitHub
commit 8e87c19125
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) {
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();