feat(codegen): generate sync and async client instantiation in ServiceWarmUpProvider.warmUp()#7101
Open
joviegas wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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>WarmUpProviderclass per service, but itswarmUp()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
CannedResponseAsyncHttpClientin sdk-core. It is the async version of the existingCannedResponseHttpClient. It returns a fixed status code and body using aSimplePublisherand does no network I/O.WarmUpProviderSpecsowarmUp()creates and closes, using try-with-resources:!skipSyncClientGeneration);Each client uses dummy credentials,
Region.US_EAST_1, and a localendpointOverride. The try blocks are empty; no operation is called.CANNED_RESPONSEbyte constant:{}for json/rest-json/cbor,<Response/>for query/ec2/rest-xml, and an empty CBOR map for smithy-rpc-v2-cbor.CannedResponseAsyncHttpClientTest, andWarmUpProviderSpecTestcases per protocol and for the sync-skipped (async-only) case.Verified:
codegenbuild passes checkstyle and 587 tests;sdk-corepasses spotbugs;sqs,transcribestreaming(async-only), andcodegen-generated-classes-testregenerate and compile.Testing
Screenshots (if appropriate)
Types of changes
License