This is an automated email from the ASF dual-hosted git repository.
xiangfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new ca2444f Make MAX_PLAN_THREADS >= 1 (#4518)
ca2444f is described below
commit ca2444f778a15f6e44bb1ad0de67cc22f2f3fef9
Author: Xiang Fu <[email protected]>
AuthorDate: Sun Aug 11 03:26:29 2019 -0700
Make MAX_PLAN_THREADS >= 1 (#4518)
* Make MAX_PLAN_THREADS >= 1
* add more commets
---
.../src/main/java/org/apache/pinot/core/plan/CombinePlanNode.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/plan/CombinePlanNode.java
b/pinot-core/src/main/java/org/apache/pinot/core/plan/CombinePlanNode.java
index c0cce5a..b73d2da 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/plan/CombinePlanNode.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/plan/CombinePlanNode.java
@@ -39,7 +39,12 @@ import org.slf4j.LoggerFactory;
public class CombinePlanNode implements PlanNode {
private static final Logger LOGGER =
LoggerFactory.getLogger(CombinePlanNode.class);
- private static final int MAX_PLAN_THREADS = Math.min(10, (int)
(Runtime.getRuntime().availableProcessors() * .5));
+ /**
+ * MAX_PLAN_THREADS should be >= 1.
+ * Runtime.getRuntime().availableProcessors() may return value < 2 in
container based environment, e.g. Kubernetes.
+ */
+ private static final int MAX_PLAN_THREADS =
+ Math.max(1, Math.min(10, (int)
(Runtime.getRuntime().availableProcessors() * .5)));
private static final int MIN_TASKS_PER_THREAD = 10;
private static final int TIME_OUT_IN_MILLISECONDS_FOR_PARALLEL_RUN = 10_000;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]