Skip to content

Commit

Permalink
Fall back to naive parallel forks calculation in non-standard cases (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
mark-vieira committed Mar 28, 2022
1 parent 16d4d07 commit be4576b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@ public static int findDefaultParallel(Project project) {
});

_defaultParallel = Integer.parseInt(stdout.toString().trim());
} else {
}

if (_defaultParallel == null || _defaultParallel < 1) {
_defaultParallel = Runtime.getRuntime().availableProcessors() / 2;
}

}

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

0 comments on commit be4576b

Please sign in to comment.