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

View File

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