Skip to content

feat(codegen): generate sync and async client instantiation in ServiceWarmUpProvider.warmUp()#7101

Open
joviegas wants to merge 2 commits into
feature/master/crac_auto_priming_supportfrom
joviegas/crac_async_prime_im
Open

feat(codegen): generate sync and async client instantiation in ServiceWarmUpProvider.warmUp()#7101
joviegas wants to merge 2 commits into
feature/master/crac_auto_priming_supportfrom
joviegas/crac_async_prime_im

Conversation

@joviegas

@joviegas joviegas commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

CRaC auto-priming runs each service's warm-up code before a checkpoint so the first call after restore is fast. PR #7085 generates a <Service>WarmUpProvider class per service, but its warmUp() method is empty.

This PR fills warmUp() with client creation: build and close a sync and an async client that use an in-memory HTTP client instead of the network. This makes the JVM compile the client build and config code during warm-up. Calling an actual operation is a later PR.
Note that the operation call will be added in upcoming PRs

Modifications

  • Add CannedResponseAsyncHttpClient in sdk-core. It is the async version of the existing CannedResponseHttpClient. It returns a fixed status code and body using a SimplePublisher and does no network I/O.
  • Change WarmUpProviderSpec so warmUp() creates and closes, using try-with-resources:
    • a sync client, only when the service generates one (!skipSyncClientGeneration);
    • an async client, always.
      Each client uses dummy credentials, Region.US_EAST_1, and a local endpointOverride. The try blocks are empty; no operation is called.
  • Add a per-protocol CANNED_RESPONSE byte constant: {} for json/rest-json/cbor, <Response/> for query/ec2/rest-xml, and an empty CBOR map for smithy-rpc-v2-cbor.
  • Add tests: CannedResponseAsyncHttpClientTest, and WarmUpProviderSpecTest cases per protocol and for the sync-skipped (async-only) case.

Verified: codegen build passes checkstyle and 587 tests; sdk-core passes spotbugs; sqs, transcribestreaming (async-only), and codegen-generated-classes-test regenerate and compile.

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

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 2, 2026 23:44
@joviegas joviegas changed the title Initialn chages for adding Client instantiation as part of warmup feat(codegen): generate sync and async client instantiation in ServiceWarmUpProvider.warmUp() Jul 2, 2026
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