Copilot commented on code in PR #13115:
URL: https://github.com/apache/gluten/pull/13115#discussion_r4120109874
##########
cpp/velox/compute/VeloxBackend.cc:
##########
@@ -328,6 +329,17 @@ ReaderThreadPool* VeloxBackend::getReaderThreadPool() {
return readerThreadPool_.get();
}
+folly::Executor* VeloxBackend::hashTableBuildExecutor() {
+ std::call_once(hashTableBuildExecutorInit_, [this] {
+ const auto defaultThreads =
backendConf_->get<int32_t>(kNumTaskSlotsPerExecutor, 1);
+ // Parallel builds still need a worker when there are no task slots.
+ const auto numThreads =
+ std::max<int32_t>(1,
backendConf_->get<int32_t>(kHashTableBuildThreads, defaultThreads));
Review Comment:
A configured value of `0` or a negative value is documented to fall back to
`kNumTaskSlotsPerExecutor`, but this expression instead clamps that configured
value directly to one. For example, with eight task slots and
`hashTableBuildThreads=0`, the new pool has one worker rather than preserving
the previous default sizing. Resolve the fallback first, then apply the
minimum-one clamp.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]