Skip to content

Commit be4576b

Browse files
authored
Fall back to naive parallel forks calculation in non-standard cases (#85410) (#85422)
Some architectures provide non-standard output in /proc/cpuinfo. Specifically, AWS graviton. In case we can't properly calculate physical cpu cores via the standard method just fallback to using the JDK-backed implementation.
1 parent 16d4d07 commit be4576b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/info/ParallelDetector.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ public static int findDefaultParallel(Project project) {
7575
});
7676

7777
_defaultParallel = Integer.parseInt(stdout.toString().trim());
78-
} else {
78+
}
79+
80+
if (_defaultParallel == null || _defaultParallel < 1) {
7981
_defaultParallel = Runtime.getRuntime().availableProcessors() / 2;
8082
}
83+
8184
}
8285

8386
return Math.min(_defaultParallel, project.getGradle().getStartParameter().getMaxWorkerCount());

0 commit comments

Comments
 (0)