aws-sdk-core 3.32.0 → 3.33.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36bc606a9e210e1a516348d0bf72d59a7fb1d286
4
- data.tar.gz: 0efe50f5988bb218ec1fb427eff4a6ae905186f1
3
+ metadata.gz: d059e3419a8fbe253f7a5a5496da534ed922dec8
4
+ data.tar.gz: 577361c360e835b9f8a06888c6a7d0928767cae8
5
5
  SHA512:
6
- metadata.gz: 8fed0dde0685c531a19ea249a788caf4ffd93b15696a032e81268617c6da8c0d40cfe7fa4b2d59701dfed6a44213b6d56771d58b9ec3619374c5288dfc3f8392
7
- data.tar.gz: a79c2b80e02f44a7bc08cba1851b8c22a66b0cd172858367626a633795606169b3de63bde9e15d98319806851d5e1a35ccca88ac1572979c95a52b3aa17a3760
6
+ metadata.gz: e45911f87a2827cd4e0a3d9ef68c368dd438a161c24b992f43cfcdbeaa9222469cd02b255d347078fb4a4c65b8e9943d5f3a89fa94de6bfd2c9d19c82ede53c5
7
+ data.tar.gz: 530473d265b8e06cc261648947f605af845d255ff52956d9bd2658c2492737eb562a2860b6fa239cfbaf5ec114a532b6652acb6485d393718ccc6789e5c3f49e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.32.0
1
+ 3.33.0
@@ -42,7 +42,7 @@ module Aws
42
42
 
43
43
  class ApiCall
44
44
  attr_reader :service, :api, :client_id, :timestamp, :version,
45
- :attempt_count, :latency, :region
45
+ :attempt_count, :latency, :region, :max_retries_exceeded
46
46
 
47
47
  def initialize(service, api, client_id, version, timestamp, region)
48
48
  @service = service
@@ -56,6 +56,11 @@ module Aws
56
56
  def complete(opts = {})
57
57
  @latency = opts[:latency]
58
58
  @attempt_count = opts[:attempt_count]
59
+ if opts[:final_error_retryable]
60
+ @max_retries_exceeded = 1
61
+ else
62
+ @max_retries_exceeded = 0
63
+ end
59
64
  end
60
65
 
61
66
  def to_json(*a)
@@ -68,7 +73,8 @@ module Aws
68
73
  "Version" => @version,
69
74
  "AttemptCount" => @attempt_count,
70
75
  "Latency" => @latency,
71
- "Region" => @region
76
+ "Region" => @region,
77
+ "MaxRetriesExceeded" => @max_retries_exceeded
72
78
  }.to_json
73
79
  end
74
80
  end
@@ -103,11 +103,19 @@ all generated client side metrics. Defaults to an empty string.
103
103
  timestamp: DateTime.now.strftime('%Q').to_i,
104
104
  )
105
105
  context.metadata[:client_metrics] = request_metrics
106
- start_time = Time.now
106
+ start_time = Aws::Util.monotonic_milliseconds
107
+ final_error_retryable = false
107
108
  begin
108
109
  @handler.call(context)
109
110
  rescue StandardError => e
110
111
  # Handle SDK Exceptions
112
+ inspector = Aws::Plugins::RetryErrors::ErrorInspector.new(
113
+ e,
114
+ context.http_response.status_code
115
+ )
116
+ if inspector.retryable?(context)
117
+ final_error_retryable = true
118
+ end
111
119
  if request_metrics.api_call_attempts.empty?
112
120
  attempt = request_metrics.build_call_attempt
113
121
  attempt.sdk_exception = e.class.to_s
@@ -127,10 +135,11 @@ all generated client side metrics. Defaults to an empty string.
127
135
  end # Else we don't have an SDK exception and are done.
128
136
  raise e
129
137
  ensure
130
- end_time = Time.now
138
+ end_time = Aws::Util.monotonic_milliseconds
131
139
  request_metrics.api_call.complete(
132
- latency: ((end_time - start_time) * 1000).to_i,
133
- attempt_count: context.retries + 1
140
+ latency: end_time - start_time,
141
+ attempt_count: context.retries + 1,
142
+ final_error_retryable: final_error_retryable
134
143
  )
135
144
  # Report the metrics by passing the complete RequestMetrics object
136
145
  if publisher
@@ -15,10 +15,10 @@ module Aws
15
15
 
16
16
  class LatencyHandler < Seahorse::Client::Handler
17
17
  def call(context)
18
- start_time = Time.now
18
+ start_time = Aws::Util.monotonic_milliseconds
19
19
  resp = @handler.call(context)
20
- end_time = Time.now
21
- latency = ((end_time - start_time) * 1000).to_i
20
+ end_time = Aws::Util.monotonic_milliseconds
21
+ latency = end_time - start_time
22
22
  context.metadata[:current_call_attempt].request_latency = latency
23
23
  resp
24
24
  end
@@ -120,8 +120,20 @@ A delay randomiser function used by the default backoff function. Some predefine
120
120
  (500..599).include?(@http_status_code)
121
121
  end
122
122
 
123
+ def retryable?(context)
124
+ (expired_credentials? and refreshable_credentials?(context)) or
125
+ throttling_error? or
126
+ checksum? or
127
+ networking? or
128
+ server?
129
+ end
130
+
123
131
  private
124
132
 
133
+ def refreshable_credentials?(context)
134
+ context.config.credentials.respond_to?(:refresh!)
135
+ end
136
+
125
137
  def extract_name(error)
126
138
  if error.is_a?(Errors::ServiceError)
127
139
  error.class.code
@@ -174,23 +186,11 @@ A delay randomiser function used by the default backoff function. Some predefine
174
186
  end
175
187
 
176
188
  def should_retry?(context, error)
177
- retryable?(context, error) and
189
+ error.retryable?(context) and
178
190
  context.retries < retry_limit(context) and
179
191
  response_truncatable?(context)
180
192
  end
181
193
 
182
- def retryable?(context, error)
183
- (error.expired_credentials? and refreshable_credentials?(context)) or
184
- error.throttling_error? or
185
- error.checksum? or
186
- error.networking? or
187
- error.server?
188
- end
189
-
190
- def refreshable_credentials?(context)
191
- context.config.credentials.respond_to?(:refresh!)
192
- end
193
-
194
194
  def retry_limit(context)
195
195
  context.config.retry_limit
196
196
  end
@@ -43,6 +43,15 @@ module Aws
43
43
  end
44
44
  end
45
45
  end
46
+
47
+ def monotonic_milliseconds
48
+ if defined?(Process::CLOCK_MONOTONIC)
49
+ Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
50
+ else
51
+ DateTime.now.strftime('%Q').to_i
52
+ end
53
+ end
54
+
46
55
  end
47
56
  end
48
57
  end
@@ -40,6 +40,6 @@ require_relative 'aws-sdk-sts/customizations'
40
40
  # @service
41
41
  module Aws::STS
42
42
 
43
- GEM_VERSION = '3.32.0'
43
+ GEM_VERSION = '3.33.0'
44
44
 
45
45
  end
@@ -1506,7 +1506,7 @@ module Aws::STS
1506
1506
  params: params,
1507
1507
  config: config)
1508
1508
  context[:gem_name] = 'aws-sdk-core'
1509
- context[:gem_version] = '3.32.0'
1509
+ context[:gem_version] = '3.33.0'
1510
1510
  Seahorse::Client::Request.new(handlers, context)
1511
1511
  end
1512
1512
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.32.0
4
+ version: 3.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-18 00:00:00.000000000 Z
11
+ date: 2018-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath