Skip to content

(feat:prime/crac) Invoke the selected warm-up operation in the generated SdkWarmUpProvider#7159

Open
joviegas wants to merge 4 commits into
feature/master/crac_auto_priming_supportfrom
joviegas/warmup_op_selector
Open

(feat:prime/crac) Invoke the selected warm-up operation in the generated SdkWarmUpProvider#7159
joviegas wants to merge 4 commits into
feature/master/crac_auto_priming_supportfrom
joviegas/warmup_op_selector

Conversation

@joviegas

@joviegas joviegas commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

The generated SdkWarmUpProvider built sync and async clients but made no request, so the marshalling, signing and unmarshalling paths stayed cold before the CRaC checkpoint. WarmUpOperationSelector already picks a safe operation per service but was not wired into codegen.

Modifications

  • WarmUpProviderSpec selects the operation via WarmUpOperationSelector and emits a call to it inside each client's try-with-resources. The async path appends .join().
  • Regenerated the six warmup-provider-*.java to include the operation call.
  • Added WarmUpProviderBindingTest in codegen-generated-classes-test. It drives the generated ProtocolRestJsonWarmUpProvider through warmUpClient(SYNC), warmUpClient(ASYNC) and warmUp(), and asserts the selected operation (AllTypes) runs. A global OperationRecordingInterceptor observes the calls made by the client the provider builds internally.

Testing

  • Added Junits
  • Also generated
  • Note that this PR is only for Codehen changes and test. How will add another PR covering tests for actual generated services in warm-up tests or something like smoke-test in each service module.
### Generated Code for DDB
    @Override
    public void warmUpClient(ClientType clientType) {
        if (clientType == ClientType.SYNC) {
            SdkHttpClient httpClient = CannedResponseHttpClient.builder().responseBody(CANNED_RESPONSE).statusCode(200).build();
            try (DynamoDbClient client = DynamoDbClient.builder().httpClient(httpClient)
                    .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid")))
                    .region(Region.US_EAST_1).endpointOverride(URI.create("http://localhost")).build()) {
                client.listBackups();
            }
        }
        if (clientType == ClientType.ASYNC) {
            SdkAsyncHttpClient asyncHttpClient = CannedResponseAsyncHttpClient.builder().responseBody(CANNED_RESPONSE)
                    .statusCode(200).build();
            try (DynamoDbAsyncClient asyncClient = DynamoDbAsyncClient.builder().httpClient(asyncHttpClient)
                    .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid")))
                    .region(Region.US_EAST_1).endpointOverride(URI.create("http://localhost")).build()) {
                asyncClient.listBackups().join();
            }
        }
    }

License

  • I confirm that this pull request can be released under the Apache 2 license

@joviegas
joviegas requested a review from a team as a code owner July 17, 2026 16:00
@joviegas joviegas changed the title Joviegas/warmup op selector (feat:prime/crac) Invoke the selected warm-up operation in the generated SdkWarmUpProvider Jul 17, 2026
@joviegas
joviegas force-pushed the joviegas/warmup_op_selector branch from 0a47adc to 6a8597c Compare July 17, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant