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 +4 -4
- data/VERSION +1 -1
- data/lib/aws-sdk-core/client_side_monitoring/request_metrics.rb +8 -2
- data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +13 -4
- data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +3 -3
- data/lib/aws-sdk-core/plugins/retry_errors.rb +13 -13
- data/lib/aws-sdk-core/util.rb +9 -0
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d059e3419a8fbe253f7a5a5496da534ed922dec8
|
4
|
+
data.tar.gz: 577361c360e835b9f8a06888c6a7d0928767cae8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e45911f87a2827cd4e0a3d9ef68c368dd438a161c24b992f43cfcdbeaa9222469cd02b255d347078fb4a4c65b8e9943d5f3a89fa94de6bfd2c9d19c82ede53c5
|
7
|
+
data.tar.gz: 530473d265b8e06cc261648947f605af845d255ff52956d9bd2658c2492737eb562a2860b6fa239cfbaf5ec114a532b6652acb6485d393718ccc6789e5c3f49e
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
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 =
|
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 =
|
138
|
+
end_time = Aws::Util.monotonic_milliseconds
|
131
139
|
request_metrics.api_call.complete(
|
132
|
-
latency:
|
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 =
|
18
|
+
start_time = Aws::Util.monotonic_milliseconds
|
19
19
|
resp = @handler.call(context)
|
20
|
-
end_time =
|
21
|
-
latency =
|
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
|
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
|
data/lib/aws-sdk-core/util.rb
CHANGED
@@ -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
|
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|