{"record":{"id":"8d53800a3b6449f9","repo":"elastic/elasticsearch","slug":"system-property-bwc-throttle-maxparallelusages-m-8d5380","errorCode":null,"errorMessage":"System property 'bwc.throttle.maxParallelUsages' must be an integer value","messagePattern":"System property 'bwc\\.throttle\\.maxParallelUsages' must be an integer value","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcSetupExtension.java","lineNumber":211,"sourceCode":"            configAction.execute(loggedExec);\n        });\n    }\n\n    private static void configureBwcThrottle(Project project, LoggedExec loggedExec) {\n        Provider<String> throttleProperty = project.getProviders().systemProperty(BWC_THROTTLE_MAX_PARALLEL_USAGES);\n        if (throttleProperty.isPresent()) {\n            try {\n                int maxParallelUsages = Integer.parseInt(throttleProperty.get());\n                if (maxParallelUsages < 1) {\n                    throw new GradleException(\"System property 'bwc.throttle.maxParallelUsages' must be >= 1\");\n                }\n                Provider<BwcThrottle> throttle = project.getGradle()\n                    .getSharedServices()\n                    .registerIfAbsent(\"bwcThrottle\", BwcThrottle.class, spec -> spec.getMaxParallelUsages().set(maxParallelUsages));\n\n                loggedExec.usesService(throttle);\n            } catch (NumberFormatException e) {\n                throw new GradleException(\"System property 'bwc.throttle.maxParallelUsages' must be an integer value\", e);\n            }\n        }\n    }\n\n    /** A convenience method for getting java home for a version of java and requiring that version for the given task to execute */\n    private static Provider<String> getJavaHome(ObjectFactory objectFactory, JavaToolchainService toolChainService, final int version) {\n        Property<JavaLanguageVersion> value = objectFactory.property(JavaLanguageVersion.class).value(JavaLanguageVersion.of(version));\n        return toolChainService.launcherFor(javaToolchainSpec -> javaToolchainSpec.getLanguageVersion().value(value))\n            .map(launcher -> launcher.getMetadata().getInstallationPath().getAsFile().getAbsolutePath());\n    }\n\n    /**\n     * A {@link ValueSource} that lists all JDK installations provisioned by the Gradle toolchain resolver\n     * under the {@code jdks/} subdirectory of the Gradle user home directory.\n     *\n     * <p>The resolver stores each JDK two levels deep:\n     * {@code jdks/<vendor-version-arch-os>/<jdk-bundle>/}.  This source collects every\n     * second-level directory (the actual JDK bundles) and returns them as a comma-separated","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcSetupExtension.java#L193-L229","documentation":"Thrown by BwcSetupExtension.configureBwcThrottle when the system property bwc.throttle.maxParallelUsages cannot be parsed as an int (NumberFormatException). It wraps the original parse exception so the user sees the cause.","triggerScenarios":"Running the build with -Dbwc.throttle.maxParallelUsages=abc or any non-integer token.","commonSituations":"Typo in the property value; CI templating that injects an empty or non-numeric string; quoting error in a shell wrapper.","solutions":["Provide a valid integer, e.g. -Dbwc.throttle.maxParallelUsages=2.","Omit the property to skip throttle configuration.","Check CI/shell quoting around the value."],"exampleFix":"// before\n./gradlew bwcTest -Dbwc.throttle.maxParallelUsages=two\n// after\n./gradlew bwcTest -Dbwc.throttle.maxParallelUsages=2","handlingStrategy":"validation","validationCode":"String raw = System.getProperty(\"bwc.throttle.maxParallelUsages\");\nif (raw != null) {\n    Integer.parseInt(raw); // throws NumberFormatException if invalid\n}","typeGuard":null,"tryCatchPattern":"try {\n    Integer.parseInt(throttleProperty.get());\n} catch (NumberFormatException e) {\n    throw new GradleException(\"bwc.throttle.maxParallelUsages must be an integer value\", e);\n}","preventionTips":["Quote numeric system properties correctly in shell wrappers.","Validate CI template variables that feed this property.","Provide a sane default and omit the property when unsure."],"tags":["gradle","bwc","throttle","build-tools"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}