From 0f2d90f9b3c384d92945cf7797022b4e070584e9 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Tue, 10 Dec 2019 07:06:52 +1100 Subject: [PATCH] Temp workaround: use a single thread to generate native image Workaround for https://github.com/oracle/graal/issues/1927 Should be possible to remove this in 19.3.1 This is a different problem to the previous one that this fix worked around, however because we were using this setting we only ran into the thread safety problem after it was removed. --- .../quarkus/deployment/pkg/steps/NativeImageBuildStep.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java index c4f43fab7b908..ca6a5219f0bc1 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java @@ -203,6 +203,11 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa command.add("-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime"); //the default collection policy results in full GC's 50% of the time command.add("-jar"); command.add(runnerJarName); + //dynamic proxy generation is not thread safe + //should be fixed in 19.3.1 + //but we need to add this option back to prevent intermittent failures + //https://github.com/oracle/graal/issues/1927 + command.add("-J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1"); if (nativeConfig.enableFallbackImages) { command.add("-H:FallbackThreshold=5"); } else {