aws-sdk-cpp icon indicating copy to clipboard operation
aws-sdk-cpp copied to clipboard

Aws retry settings are not working

Open Manjunathagopi opened this issue 1 year ago • 3 comments

Can someone explain how this retry strategy works, i configured timeout configs to 100ms and retry strategy to NO_RETRY. But still i am seeing requests are not getting cancelled and time to get object is more than 1 second.

sample code snippet.

Aws::S3Crt::ClientConfiguration config;
 config.httpRequestTimeoutMs = 100;
 config.connectTimeoutMs = 100;
 config.requestTimeoutMs = 100;  
 config.crtRetryStrategyConfig.crtRetryStrategyType = 
 Aws::S3Crt::S3CrtClientConfiguration::CrtRetryStrategyConfig::CrtRetryStrategyType::NO_RETRY;
 config.throughputTargetGbps = 1;
 config.partSize = 10*1024*1024;
 s3_crt_client = Aws::New<Aws::S3Crt::S3CrtClient>("test", config);

aws cpp SDK version : 1.11.408

Originally posted by @Manjunathagopi in https://github.com/aws/aws-sdk-cpp/issues/2594#issuecomment-2363445635

Manjunathagopi avatar Sep 30 '24 05:09 Manjunathagopi

  • httpReqTimeout is not used in s3crt
  • connectTimeoutMs is used as a limit to how long to wait before the tls connection is established
  • requestTimeoutMs is used but it's complicated. You can see it's usage here

jmklix avatar Oct 04 '24 00:10 jmklix

Hi @jmklix thanks for the response. Will retry strategy works for crt client? If yes can you please tell us how it actually works?

Manjunathagopi avatar Oct 04 '24 10:10 Manjunathagopi

Yes, retry strategy should work for the s3crt client. It was added recently in this PR: https://github.com/aws/aws-sdk-cpp/pull/3110. So please make sure that you are using the latest version of this sdk. You can check out the pr for details of how each option is supposed to work, but for NO_RETRY it uses:

    if (strategyToUse == CrtRetryStrategyType::NO_RETRY)
    {
      aws_standard_retry_options options {};
      options.initial_bucket_capacity = 1;
      return aws_retry_strategy_new_standard(Aws::get_aws_allocator(), &options);
    }

And then that called this:

    /* standard default is 3. */
    if (!config->backoff_retry_options.max_retries) {
        config_cpy.max_retries = 3;
    }

So it looks like this might not be working correctly as I don't see max_retries get set for anything other then EXPONENTIAL_BACKOFF. Still looking into this

jmklix avatar Oct 04 '24 22:10 jmklix

This should be fixed with this PR. Please update to the latest version on this sdk and let us know if you see any more unexpected behavior with the retry settings

jmklix avatar Nov 27 '24 22:11 jmklix

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar Nov 27 '24 22:11 github-actions[bot]