Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime initialize amazon-services classes using j.u.Random #15897

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.deployment.configuration.ConfigurationError;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
Expand All @@ -43,6 +44,13 @@ void awsAppArchiveMarkers(BuildProducer<AdditionalApplicationArchiveMarkerBuildI
archiveMarker.produce(new AdditionalApplicationArchiveMarkerBuildItem(AWS_SDK_XRAY_ARCHIVE_MARKER));
}

@BuildStep
void runtimeInitialize(BuildProducer<RuntimeInitializedClassBuildItem> producer) {
// FullJitterBackoffStrategy uses j.u.Ramdom, so needs to be runtime-initialized
producer.produce(
new RuntimeInitializedClassBuildItem("software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy"));
}

@BuildStep
void setup(CombinedIndexBuildItem combinedIndexBuildItem,
List<AmazonClientBuildItem> amazonClients,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;

Expand Down Expand Up @@ -68,6 +69,14 @@ AdditionalBeanBuildItem producer() {
return AdditionalBeanBuildItem.unremovableOf(DynamodbClientProducer.class);
}

@BuildStep
void runtimeInitialize(BuildProducer<RuntimeInitializedClassBuildItem> producer) {
// This class triggers initialization of FullJitterBackoffStragegy so needs to get runtime-initialized
// as well
producer.produce(
new RuntimeInitializedClassBuildItem("software.amazon.awssdk.services.dynamodb.DynamoDbRetryPolicy"));
}

@BuildStep
void setup(BeanRegistrationPhaseBuildItem beanRegistrationPhase,
BuildProducer<ExtensionSslNativeSupportBuildItem> extensionSslNativeSupport,
Expand Down