From f303b545302e2a1532519e0952e21a3014a02869 Mon Sep 17 00:00:00 2001 From: Matt Muller Date: Mon, 28 Apr 2025 14:24:47 -0400 Subject: [PATCH 1/7] Default to standard retry --- build_tools/services.rb | 4 +- gems/aws-sdk-core/CHANGELOG.md | 2 + .../lib/aws-sdk-core/plugins/retry_errors.rb | 161 +++++++++--------- .../plugins/extended_retries.rb | 49 ++++-- 4 files changed, 113 insertions(+), 103 deletions(-) diff --git a/build_tools/services.rb b/build_tools/services.rb index 65df76e13d1..8be13078a85 100644 --- a/build_tools/services.rb +++ b/build_tools/services.rb @@ -9,10 +9,10 @@ class ServiceEnumerator MANIFEST_PATH = File.expand_path('../../services.json', __FILE__) # Minimum `aws-sdk-core` version for new gem builds - MINIMUM_CORE_VERSION = "3.216.0" + MINIMUM_CORE_VERSION = "3.223.0" # Minimum `aws-sdk-core` version for new S3 gem builds - MINIMUM_CORE_VERSION_S3 = "3.216.0" + MINIMUM_CORE_VERSION_S3 = "3.223.0" EVENTSTREAM_PLUGIN = "Aws::Plugins::EventStreamConfiguration" diff --git a/gems/aws-sdk-core/CHANGELOG.md b/gems/aws-sdk-core/CHANGELOG.md index 5f57430ac76..c8170133b83 100644 --- a/gems/aws-sdk-core/CHANGELOG.md +++ b/gems/aws-sdk-core/CHANGELOG.md @@ -1,6 +1,8 @@ Unreleased Changes ------------------ +* Feature - Set the default `retry_mode` to `standard` for all clients. + * Issue - Do not dynamically create operation methods from the API. (#3234) 3.222.2 (2025-04-16) diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb index c44a899c5fc..b97a83511e8 100644 --- a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb +++ b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb @@ -28,9 +28,7 @@ class RetryErrors < Seahorse::Client::Plugin DEFAULT_BACKOFF = lambda do |c| delay = 2**c.retries * c.config.retry_base_delay - if (c.config.retry_max_delay || 0) > 0 - delay = [delay, c.config.retry_max_delay].min - end + delay = [delay, c.config.retry_max_delay].min if (c.config.retry_max_delay || 0).positive? jitter = c.config.retry_jitter jitter = JITTERS[jitter] if jitter.is_a?(Symbol) delay = jitter.call(delay) if jitter @@ -41,32 +39,32 @@ class RetryErrors < Seahorse::Client::Plugin :retry_limit, default: 3, doc_type: Integer, - docstring: <<-DOCS) -The maximum number of times to retry failed requests. Only -~ 500 level server errors and certain ~ 400 level client errors -are retried. Generally, these are throttling errors, data -checksum errors, networking errors, timeout errors, auth errors, -endpoint discovery, and errors from expired credentials. -This option is only used in the `legacy` retry mode. + docstring: <<~DOCS) + The maximum number of times to retry failed requests. Only + ~ 500 level server errors and certain ~ 400 level client errors + are retried. Generally, these are throttling errors, data + checksum errors, networking errors, timeout errors, auth errors, + endpoint discovery, and errors from expired credentials. + This option is only used in the `legacy` retry mode. DOCS option( :retry_max_delay, default: 0, doc_type: Integer, - docstring: <<-DOCS) -The maximum number of seconds to delay between retries (0 for no limit) -used by the default backoff function. This option is only used in the -`legacy` retry mode. + docstring: <<~DOCS) + The maximum number of seconds to delay between retries (0 for no limit) + used by the default backoff function. This option is only used in the + `legacy` retry mode. DOCS option( :retry_base_delay, default: 0.3, doc_type: Float, - docstring: <<-DOCS) -The base delay in seconds used by the default backoff function. This option -is only used in the `legacy` retry mode. + docstring: <<~DOCS) + The base delay in seconds used by the default backoff function. This option + is only used in the `legacy` retry mode. DOCS option( @@ -74,45 +72,44 @@ class RetryErrors < Seahorse::Client::Plugin default: :none, doc_type: Symbol, rbs_type: '(:none | :equal | :full | ^(Integer) -> Integer)', - docstring: <<-DOCS) -A delay randomiser function used by the default backoff function. -Some predefined functions can be referenced by name - :none, :equal, :full, -otherwise a Proc that takes and returns a number. This option is only used -in the `legacy` retry mode. + docstring: <<~DOCS) + A delay randomiser function used by the default backoff function. + Some predefined functions can be referenced by name - :none, :equal, :full, + otherwise a Proc that takes and returns a number. This option is only used + in the `legacy` retry mode. -@see https://www.awsarchitectureblog.com/2015/03/backoff.html + @see https://www.awsarchitectureblog.com/2015/03/backoff.html DOCS option( :retry_backoff, default: DEFAULT_BACKOFF, doc_type: Proc, - docstring: <<-DOCS) -A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. -This option is only used in the `legacy` retry mode. + docstring: <<~DOCS) + A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. + This option is only used in the `legacy` retry mode. DOCS # END LEGACY OPTIONS option( :retry_mode, - default: 'legacy', + default: 'standard', doc_type: String, rbs_type: '("legacy" | "standard" | "adaptive")', - docstring: <<-DOCS) do |cfg| -Specifies which retry algorithm to use. Values are: + docstring: <<~DOCS) do |cfg| + Specifies which retry algorithm to use. Values are: -* `legacy` - The pre-existing retry behavior. This is default value if - no retry mode is provided. + * `legacy` - The pre-existing retry behavior. -* `standard` - A standardized set of retry rules across the AWS SDKs. - This includes support for retry quotas, which limit the number of - unsuccessful retries a client can make. + * `standard` - A standardized set of retry rules across the AWS SDKs. + This includes support for retry quotas, which limit the number of + unsuccessful retries a client can make. -* `adaptive` - An experimental retry mode that includes all the - functionality of `standard` mode along with automatic client side - throttling. This is a provisional mode that may change behavior - in the future. + * `adaptive` - An experimental retry mode that includes all the + functionality of `standard` mode along with automatic client side + throttling. This is a provisional mode that may change behavior + in the future. DOCS resolve_retry_mode(cfg) end @@ -121,11 +118,11 @@ class RetryErrors < Seahorse::Client::Plugin :max_attempts, default: 3, doc_type: Integer, - docstring: <<-DOCS) do |cfg| -An integer representing the maximum number attempts that will be made for -a single request, including the initial attempt. For example, -setting this value to 5 will result in a request being retried up to -4 times. Used in `standard` and `adaptive` retry modes. + docstring: <<~DOCS) do |cfg| + An integer representing the maximum number attempts that will be made for + a single request, including the initial attempt. For example, + setting this value to 5 will result in a request being retried up to + 4 times. Used in `standard` and `adaptive` retry modes. DOCS resolve_max_attempts(cfg) end @@ -134,11 +131,11 @@ class RetryErrors < Seahorse::Client::Plugin :adaptive_retry_wait_to_fill, default: true, doc_type: 'Boolean', - docstring: <<-DOCS) do |cfg| -Used only in `adaptive` retry mode. When true, the request will sleep -until there is sufficent client side capacity to retry the request. -When false, the request will raise a `RetryCapacityNotAvailableError` and will -not retry instead of sleeping. + docstring: <<~DOCS) do |cfg| + Used only in `adaptive` retry mode. When true, the request will sleep + until there is sufficent client side capacity to retry the request. + When false, the request will raise a `RetryCapacityNotAvailableError` and will + not retry instead of sleeping. DOCS resolve_adaptive_retry_wait_to_fill(cfg) end @@ -147,10 +144,10 @@ class RetryErrors < Seahorse::Client::Plugin :correct_clock_skew, default: true, doc_type: 'Boolean', - docstring: <<-DOCS) do |cfg| -Used only in `standard` and adaptive retry modes. Specifies whether to apply -a clock skew correction and retry requests with skewed client clocks. - DOCS + docstring: <<~DOCS) do |cfg| + Used only in `standard` and adaptive retry modes. Specifies whether to apply + a clock skew correction and retry requests with skewed client clocks. + DOCS resolve_correct_clock_skew(cfg) end @@ -164,20 +161,19 @@ class RetryErrors < Seahorse::Client::Plugin option(:clock_skew) { Retries::ClockSkew.new } def self.resolve_retry_mode(cfg) - default_mode_value = - if cfg.respond_to?(:defaults_mode_config_resolver) - cfg.defaults_mode_config_resolver.resolve(:retry_mode) - end + if cfg.respond_to?(:defaults_mode_config_resolver) + default_mode_value = cfg.defaults_mode_config_resolver.resolve(:retry_mode) + end - value = ENV['AWS_RETRY_MODE'] || - Aws.shared_config.retry_mode(profile: cfg.profile) || - default_mode_value || - 'legacy' + value = ENV['AWS_RETRY_MODE'] || + Aws.shared_config.retry_mode(profile: cfg.profile) || + default_mode_value || + 'standard' # Raise if provided value is not one of the retry modes if value != 'legacy' && value != 'standard' && value != 'adaptive' raise ArgumentError, - 'Must provide either `legacy`, `standard`, or `adaptive` for '\ - 'retry_mode profile option or for ENV[\'AWS_RETRY_MODE\']' + 'Must provide either `legacy`, `standard`, or `adaptive` for '\ + 'retry_mode profile option or for ENV[\'AWS_RETRY_MODE\']' end value end @@ -190,40 +186,41 @@ def self.resolve_max_attempts(cfg) # Raise if provided value is not a positive integer if value <= 0 raise ArgumentError, - 'Must provide a positive integer for max_attempts profile '\ - 'option or for ENV[\'AWS_MAX_ATTEMPTS\']' + 'Must provide a positive integer for max_attempts profile '\ + 'option or for ENV[\'AWS_MAX_ATTEMPTS\']' end value end def self.resolve_adaptive_retry_wait_to_fill(cfg) value = ENV['AWS_ADAPTIVE_RETRY_WAIT_TO_FILL'] || - Aws.shared_config.adaptive_retry_wait_to_fill(profile: cfg.profile) || - 'true' + Aws.shared_config.adaptive_retry_wait_to_fill(profile: cfg.profile) || + 'true' # Raise if provided value is not true or false if value != 'true' && value != 'false' raise ArgumentError, - 'Must provide either `true` or `false` for '\ - 'adaptive_retry_wait_to_fill profile option or for '\ - 'ENV[\'AWS_ADAPTIVE_RETRY_WAIT_TO_FILL\']' + 'Must provide either `true` or `false` for '\ + 'adaptive_retry_wait_to_fill profile option or for '\ + 'ENV[\'AWS_ADAPTIVE_RETRY_WAIT_TO_FILL\']' end value == 'true' end def self.resolve_correct_clock_skew(cfg) value = ENV['AWS_CORRECT_CLOCK_SKEW'] || - Aws.shared_config.correct_clock_skew(profile: cfg.profile) || - 'true' + Aws.shared_config.correct_clock_skew(profile: cfg.profile) || + 'true' # Raise if provided value is not true or false if value != 'true' && value != 'false' raise ArgumentError, - 'Must provide either `true` or `false` for '\ - 'correct_clock_skew profile option or for '\ - 'ENV[\'AWS_CORRECT_CLOCK_SKEW\']' + 'Must provide either `true` or `false` for '\ + 'correct_clock_skew profile option or for '\ + 'ENV[\'AWS_CORRECT_CLOCK_SKEW\']' end value == 'true' end + # @api private class Handler < Seahorse::Client::Handler # Max backoff (in seconds) MAX_BACKOFF = 20 @@ -249,9 +246,7 @@ def call(context) # Clock correction needs to be updated from the response even when # the request is not retryable but should only be updated # in the case of clock skew errors - if error_inspector.clock_skew?(context) - config.clock_skew.update_clock_correction(context) - end + config.clock_skew.update_clock_correction(context) if error_inspector.clock_skew?(context) # Estimated skew needs to be updated on every request config.clock_skew.update_estimated_skew(context) @@ -262,7 +257,7 @@ def call(context) context.metadata[:retries][:capacity_amount] = config.retry_quota.checkout_capacity(error_inspector) - return response unless context.metadata[:retries][:capacity_amount] > 0 + return response unless (context.metadata[:retries][:capacity_amount]).positive? delay = exponential_backoff(context.retries) Kernel.sleep(delay) @@ -348,9 +343,7 @@ def compute_request_ttl(context) endpoint = context.http_request.endpoint estimated_skew = context.config.clock_skew.estimated_skew(endpoint) - if context.config.respond_to?(:http_read_timeout) - read_timeout = context.config.http_read_timeout - end + read_timeout = context.config.http_read_timeout if context.config.respond_to?(:http_read_timeout) if estimated_skew && read_timeout (Time.now.utc + read_timeout + estimated_skew) @@ -359,8 +352,8 @@ def compute_request_ttl(context) end end + # @api private class LegacyHandler < Seahorse::Client::Handler - def call(context) response = with_metric { @handler.call(context) } if response.error @@ -429,9 +422,7 @@ def response_truncatable?(context) def add_handlers(handlers, config) if config.retry_mode == 'legacy' - if config.retry_limit > 0 - handlers.add(LegacyHandler, step: :sign, priority: 99) - end + handlers.add(LegacyHandler, step: :sign, priority: 99) if config.retry_limit.positive? else handlers.add(Handler, step: :sign, priority: 99) end diff --git a/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb b/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb index 6b50bac980d..65407d6ba18 100644 --- a/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb +++ b/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb @@ -4,6 +4,8 @@ module Aws module DynamoDB module Plugins class ExtendedRetries < Seahorse::Client::Plugin + # BEGIN LEGACY OPTIONS + DEFAULT_BACKOFF = lambda do |c| return unless c.retries > 1 @@ -21,32 +23,47 @@ class ExtendedRetries < Seahorse::Client::Plugin :retry_limit, default: 10, doc_type: Integer, - docstring: <<-DOCS) -The maximum number of times to retry failed requests. Only -~ 500 level server errors and certain ~ 400 level client errors -are retried. Generally, these are throttling errors, data -checksum errors, networking errors, timeout errors, auth errors, -endpoint discovery, and errors from expired credentials. -This option is only used in the `legacy` retry mode. - DOCS + docstring: <<~DOCS) + The maximum number of times to retry failed requests. Only + ~ 500 level server errors and certain ~ 400 level client errors + are retried. Generally, these are throttling errors, data + checksum errors, networking errors, timeout errors, auth errors, + endpoint discovery, and errors from expired credentials. + This option is only used in the `legacy` retry mode. + DOCS option( :retry_base_delay, default: 0.05, doc_type: Float, - docstring: <<-DOCS) -The base delay in seconds used by the default backoff function. This option -is only used in the `legacy` retry mode. - DOCS + docstring: <<~DOCS) + The base delay in seconds used by the default backoff function. This option + is only used in the `legacy` retry mode. + DOCS option( :retry_backoff, default: DEFAULT_BACKOFF, doc_type: Proc, - docstring: <<-DOCS) -A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. -This option is only used in the `legacy` retry mode. - DOCS + docstring: <<~DOCS) + A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. + This option is only used in the `legacy` retry mode. + DOCS + + # END LEGACY OPTIONS + + option( + :max_attempts, + default: 10, + doc_type: Integer, + docstring: <<~DOCS) do |cfg| + An integer representing the maximum number attempts that will be made for + a single request, including the initial attempt. For example, + setting this value to 5 will result in a request being retried up to + 4 times. Used in `standard` and `adaptive` retry modes. + DOCS + resolve_max_attempts(cfg) + end end end end From 270b5be32b29b27f506aada635f9cbb85788a224 Mon Sep 17 00:00:00 2001 From: Matt Muller Date: Mon, 28 Apr 2025 14:28:55 -0400 Subject: [PATCH 2/7] Add changelog to DDB --- gems/aws-sdk-dynamodb/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gems/aws-sdk-dynamodb/CHANGELOG.md b/gems/aws-sdk-dynamodb/CHANGELOG.md index d20efbc5ad2..2305305418c 100644 --- a/gems/aws-sdk-dynamodb/CHANGELOG.md +++ b/gems/aws-sdk-dynamodb/CHANGELOG.md @@ -1,6 +1,8 @@ Unreleased Changes ------------------ +* Feature - Increase the retry limit for the `standard` retry mode to 10 retries. + 1.141.0 (2025-04-24) ------------------ From 8d2641504a12b21ce035eb8c8660530a23c222bb Mon Sep 17 00:00:00 2001 From: Matt Muller Date: Mon, 28 Apr 2025 14:40:54 -0400 Subject: [PATCH 3/7] Fix tests --- gems/aws-sdk-core/spec/aws/client_spec.rb | 2 +- .../spec/aws/plugins/retry_errors_legacy_spec.rb | 4 ---- .../spec/aws/plugins/retry_errors_spec.rb | 4 ++++ .../aws-sdk-dynamodb/plugins/extended_retries.rb | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/gems/aws-sdk-core/spec/aws/client_spec.rb b/gems/aws-sdk-core/spec/aws/client_spec.rb index ab0e7d135fd..2a37fafa06a 100644 --- a/gems/aws-sdk-core/spec/aws/client_spec.rb +++ b/gems/aws-sdk-core/spec/aws/client_spec.rb @@ -65,7 +65,7 @@ module Aws end expect(e).to be_kind_of(Errors::NoSuchEndpointError) - expect(e.context.retries).to be(3) # updated to retry based on customer request + expect(e.context.retries).to be(2) # updated to retry based on customer request expect(e.message).to include('us-east-1') expect(e.message).to include('us-west-1') expect(e.message).to include('cn-north-1') diff --git a/gems/aws-sdk-core/spec/aws/plugins/retry_errors_legacy_spec.rb b/gems/aws-sdk-core/spec/aws/plugins/retry_errors_legacy_spec.rb index 067231e8004..d92afdb7005 100644 --- a/gems/aws-sdk-core/spec/aws/plugins/retry_errors_legacy_spec.rb +++ b/gems/aws-sdk-core/spec/aws/plugins/retry_errors_legacy_spec.rb @@ -24,10 +24,6 @@ module Plugins expect(client.config.retry_jitter).to eq(:none) end - it 'defaults config.retry_mode to legacy' do - expect(client.config.retry_mode).to eq('legacy') - end - it 'uses the legacy handler when retry_mode is legacy' do client = RetryErrorsSvc::Client.new(retry_mode: 'legacy', region: 'us-west-2') expect(client.handlers.entries.map(&:handler_class)).to include(RetryErrors::LegacyHandler) diff --git a/gems/aws-sdk-core/spec/aws/plugins/retry_errors_spec.rb b/gems/aws-sdk-core/spec/aws/plugins/retry_errors_spec.rb index e911e43236d..4875dc40f16 100644 --- a/gems/aws-sdk-core/spec/aws/plugins/retry_errors_spec.rb +++ b/gems/aws-sdk-core/spec/aws/plugins/retry_errors_spec.rb @@ -8,6 +8,10 @@ module Plugins describe RetryErrors do let(:client) { RetryErrorsSvc::Client.new(stub_responses: true) } + it 'defaults config.retry_mode to standard' do + expect(client.config.retry_mode).to eq('standard') + end + it 'can configure retry_mode with shared config' do allow_any_instance_of(Aws::SharedConfig) .to receive(:retry_mode).and_return('standard') diff --git a/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb b/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb index 65407d6ba18..4d2b08fc113 100644 --- a/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb +++ b/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb @@ -64,6 +64,20 @@ class ExtendedRetries < Seahorse::Client::Plugin DOCS resolve_max_attempts(cfg) end + + def self.resolve_max_attempts(cfg) + value = (ENV['AWS_MAX_ATTEMPTS']) || + Aws.shared_config.max_attempts(profile: cfg.profile) || + '10' + value = value.to_i + # Raise if provided value is not a positive integer + if value <= 0 + raise ArgumentError, + 'Must provide a positive integer for max_attempts profile '\ + 'option or for ENV[\'AWS_MAX_ATTEMPTS\']' + end + value + end end end end From 4faa194a6d8fe7b030e931e6e0f8bbbe7ba76e2a Mon Sep 17 00:00:00 2001 From: Matt Muller Date: Mon, 28 Apr 2025 14:58:25 -0400 Subject: [PATCH 4/7] Fix s3 tests --- gems/aws-sdk-s3/spec/client_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gems/aws-sdk-s3/spec/client_spec.rb b/gems/aws-sdk-s3/spec/client_spec.rb index 1fabee78a0f..968b9d83e32 100644 --- a/gems/aws-sdk-s3/spec/client_spec.rb +++ b/gems/aws-sdk-s3/spec/client_spec.rb @@ -803,7 +803,7 @@ module S3 key: 'key' }.merge(params)) expect(resp.error).to be_kind_of(S3::Errors::InternalError) - expect(resp.context.retries).to eq(3) + expect(resp.context.retries).to eq(2) expect(resp.data).to be(nil) end @@ -822,7 +822,7 @@ module S3 key: 'key' }.merge(params)) expect(resp.error).to be_kind_of(Seahorse::Client::NetworkingError) - expect(resp.context.retries).to eq(3) + expect(resp.context.retries).to eq(2) expect(resp.data).to be(nil) end end From f0f322754898466bc904e9f02c38e0e8e39e9eba Mon Sep 17 00:00:00 2001 From: Matt Muller <53055821+mullermp@users.noreply.github.com> Date: Tue, 29 Apr 2025 08:23:01 -0400 Subject: [PATCH 5/7] Update gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb Co-authored-by: Juli Tera <57973151+jterapin@users.noreply.github.com> --- gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb index b97a83511e8..1c271b46a28 100644 --- a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb +++ b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb @@ -145,7 +145,7 @@ class RetryErrors < Seahorse::Client::Plugin default: true, doc_type: 'Boolean', docstring: <<~DOCS) do |cfg| - Used only in `standard` and adaptive retry modes. Specifies whether to apply + Used only in `standard` and `adaptive` retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks. DOCS resolve_correct_clock_skew(cfg) From effa22659387494d14526c5f87e9eafe47eaaec1 Mon Sep 17 00:00:00 2001 From: Matt Muller <53055821+mullermp@users.noreply.github.com> Date: Thu, 17 Jul 2025 09:28:53 -0400 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Juli Tera <57973151+jterapin@users.noreply.github.com> --- gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb | 4 ++-- .../lib/aws-sdk-dynamodb/plugins/extended_retries.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb index 1c271b46a28..3aaacb1c1eb 100644 --- a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb +++ b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb @@ -74,7 +74,7 @@ class RetryErrors < Seahorse::Client::Plugin rbs_type: '(:none | :equal | :full | ^(Integer) -> Integer)', docstring: <<~DOCS) A delay randomiser function used by the default backoff function. - Some predefined functions can be referenced by name - :none, :equal, :full, + Some predefined functions can be referenced by name - `:none`, `:equal`, `:full`, otherwise a Proc that takes and returns a number. This option is only used in the `legacy` retry mode. @@ -86,7 +86,7 @@ class RetryErrors < Seahorse::Client::Plugin default: DEFAULT_BACKOFF, doc_type: Proc, docstring: <<~DOCS) - A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. + A proc or lambda used for backoff. Defaults to `2**retries * retry_base_delay`. This option is only used in the `legacy` retry mode. DOCS diff --git a/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb b/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb index 4d2b08fc113..9f871c5d202 100644 --- a/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb +++ b/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/plugins/extended_retries.rb @@ -46,7 +46,7 @@ class ExtendedRetries < Seahorse::Client::Plugin default: DEFAULT_BACKOFF, doc_type: Proc, docstring: <<~DOCS) - A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. + A proc or lambda used for backoff. Defaults to `2**retries * retry_base_delay`. This option is only used in the `legacy` retry mode. DOCS From 45a4b9a09dbfcc9cbcd719e14c8ba8da66817af2 Mon Sep 17 00:00:00 2001 From: Matt Muller Date: Thu, 17 Jul 2025 14:35:58 -0400 Subject: [PATCH 7/7] Minor doc fixes and include user agent fix --- .../lib/aws-sdk-core/plugins/retry_errors.rb | 47 ++++++++----------- .../lib/aws-sdk-core/plugins/user_agent.rb | 2 +- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb index 3aaacb1c1eb..72a9d8ee785 100644 --- a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb +++ b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb @@ -40,12 +40,10 @@ class RetryErrors < Seahorse::Client::Plugin default: 3, doc_type: Integer, docstring: <<~DOCS) - The maximum number of times to retry failed requests. Only - ~ 500 level server errors and certain ~ 400 level client errors - are retried. Generally, these are throttling errors, data - checksum errors, networking errors, timeout errors, auth errors, - endpoint discovery, and errors from expired credentials. - This option is only used in the `legacy` retry mode. + The maximum number of times to retry failed requests. Only ~500 level server errors + and certain ~400 level client errors are retried. Generally, these are throttling errors, + data checksum errors, networking errors, timeout errors, auth errors, and errors from + expired credentials. This option is only used in the `legacy` retry mode. DOCS option( @@ -53,9 +51,8 @@ class RetryErrors < Seahorse::Client::Plugin default: 0, doc_type: Integer, docstring: <<~DOCS) - The maximum number of seconds to delay between retries (0 for no limit) - used by the default backoff function. This option is only used in the - `legacy` retry mode. + The maximum number of seconds to delay between retries (0 for no limit) used by the + default backoff function. This option is only used in the `legacy` retry mode. DOCS option( @@ -73,12 +70,11 @@ class RetryErrors < Seahorse::Client::Plugin doc_type: Symbol, rbs_type: '(:none | :equal | :full | ^(Integer) -> Integer)', docstring: <<~DOCS) - A delay randomiser function used by the default backoff function. - Some predefined functions can be referenced by name - `:none`, `:equal`, `:full`, - otherwise a Proc that takes and returns a number. This option is only used - in the `legacy` retry mode. + A delay randomizer function used by the default backoff function. Some predefined + functions can be referenced by name - `:none`, `:equal`, `:full`, otherwise a Proc that + takes and returns a number. This option is only used in the `legacy` retry mode. - @see https://www.awsarchitectureblog.com/2015/03/backoff.html + @see https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ DOCS option( @@ -99,17 +95,16 @@ class RetryErrors < Seahorse::Client::Plugin rbs_type: '("legacy" | "standard" | "adaptive")', docstring: <<~DOCS) do |cfg| Specifies which retry algorithm to use. Values are: - * `legacy` - The pre-existing retry behavior. - * `standard` - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make. - * `adaptive` - An experimental retry mode that includes all the functionality of `standard` mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future. + + @see https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html DOCS resolve_retry_mode(cfg) end @@ -119,10 +114,9 @@ class RetryErrors < Seahorse::Client::Plugin default: 3, doc_type: Integer, docstring: <<~DOCS) do |cfg| - An integer representing the maximum number attempts that will be made for - a single request, including the initial attempt. For example, - setting this value to 5 will result in a request being retried up to - 4 times. Used in `standard` and `adaptive` retry modes. + An integer representing the maximum number attempts that will be made for a single request, + including the initial attempt. For example, setting this value to 5 will result in a + request being retried up to 4 times. Used in `standard` and `adaptive` retry modes. DOCS resolve_max_attempts(cfg) end @@ -132,10 +126,9 @@ class RetryErrors < Seahorse::Client::Plugin default: true, doc_type: 'Boolean', docstring: <<~DOCS) do |cfg| - Used only in `adaptive` retry mode. When true, the request will sleep - until there is sufficent client side capacity to retry the request. - When false, the request will raise a `RetryCapacityNotAvailableError` and will - not retry instead of sleeping. + Used only in `adaptive` retry mode. When true, the request will sleep until there is + sufficient client side capacity to retry the request. When false, the request will raise + a `RetryCapacityNotAvailableError` and will not retry instead of sleeping. DOCS resolve_adaptive_retry_wait_to_fill(cfg) end @@ -145,8 +138,8 @@ class RetryErrors < Seahorse::Client::Plugin default: true, doc_type: 'Boolean', docstring: <<~DOCS) do |cfg| - Used only in `standard` and `adaptive` retry modes. Specifies whether to apply - a clock skew correction and retry requests with skewed client clocks. + Specifies whether to apply a clock skew correction and retry requests with skewed + client clocks. Used only in `standard` and `adaptive` retry modes. DOCS resolve_correct_clock_skew(cfg) end diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/user_agent.rb b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/user_agent.rb index 5c1c3faada4..b54a7bacd95 100644 --- a/gems/aws-sdk-core/lib/aws-sdk-core/plugins/user_agent.rb +++ b/gems/aws-sdk-core/lib/aws-sdk-core/plugins/user_agent.rb @@ -61,7 +61,7 @@ class UserAgent < Seahorse::Client::Plugin # @api private option(:user_agent_suffix) # @api private - option(:user_agent_frameworks, default: []) + option(:user_agent_frameworks) { [] } option( :sdk_ua_app_id,