datadog-ci 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -2
- data/lib/datadog/ci/remote/component.rb +1 -1
- data/lib/datadog/ci/transport/http.rb +34 -7
- data/lib/datadog/ci/version.rb +1 -1
- data/lib/datadog/ci/worker.rb +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1460c3b89178f919bb71b356889f177c36f74ac11a8770f71e57eeebcd7215ff
|
4
|
+
data.tar.gz: 37d0ede02d7851e074287b465968aa36d8db4ad078329553b29b3f1eff7d76d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 617904ffa77b85fa4dfdadb3d81efffbbfc3be9c09e621ba6df7849b85cc803e10e2b5bdef802da457360b02da6c4b3ebfdad7c448c18588870566c657890830
|
7
|
+
data.tar.gz: 74f3b46a41f00d968df66673ddee9835712ae5e15d49a35ad889596f392e9b6fb4681c7575cd44159612097e0a74994e9a2e5a9da7c4f3876a5b54768c934ded
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [1.22.1] - 2025-08-25
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
* Fix configuration race condition that caused undefined library behaviour (marking old tests as new as an example) ([#402][])
|
8
|
+
|
3
9
|
## [1.22.0] - 2025-08-12
|
4
10
|
|
5
11
|
### Added
|
@@ -514,7 +520,8 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
514
520
|
|
515
521
|
- Ruby versions < 2.7 no longer supported ([#8][])
|
516
522
|
|
517
|
-
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.22.
|
523
|
+
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.22.1...main
|
524
|
+
[1.22.1]: https://github.com/DataDog/datadog-ci-rb/compare/v1.22.0...v1.22.1
|
518
525
|
[1.22.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.21.1...v1.22.0
|
519
526
|
[1.21.1]: https://github.com/DataDog/datadog-ci-rb/compare/v1.21.0...v1.21.1
|
520
527
|
[1.21.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.20.2...v1.21.0
|
@@ -731,4 +738,5 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
731
738
|
[#391]: https://github.com/DataDog/datadog-ci-rb/issues/391
|
732
739
|
[#393]: https://github.com/DataDog/datadog-ci-rb/issues/393
|
733
740
|
[#394]: https://github.com/DataDog/datadog-ci-rb/issues/394
|
734
|
-
[#396]: https://github.com/DataDog/datadog-ci-rb/issues/396
|
741
|
+
[#396]: https://github.com/DataDog/datadog-ci-rb/issues/396
|
742
|
+
[#402]: https://github.com/DataDog/datadog-ci-rb/issues/402
|
@@ -24,6 +24,21 @@ module Datadog
|
|
24
24
|
MAX_RETRIES = 3
|
25
25
|
INITIAL_BACKOFF = 1
|
26
26
|
MAX_BACKOFF = 30
|
27
|
+
MAX_RETRY_TIME = 50
|
28
|
+
|
29
|
+
# Errors that should not be retried - fail fast
|
30
|
+
NON_RETRIABLE_ERRORS = [
|
31
|
+
Timeout::Error, # Don't slow down customers with timeouts
|
32
|
+
Errno::EINVAL, # Invalid argument
|
33
|
+
Net::HTTPBadResponse # Malformed response - likely persistent issue
|
34
|
+
].freeze
|
35
|
+
|
36
|
+
# Errors that can be retried - transient network issues
|
37
|
+
RETRIABLE_ERRORS = [
|
38
|
+
Errno::ECONNRESET, # Connection reset by peer
|
39
|
+
EOFError, # Unexpected connection close
|
40
|
+
SocketError # DNS/network issues
|
41
|
+
].freeze
|
27
42
|
|
28
43
|
def initialize(host:, port:, timeout: DEFAULT_TIMEOUT, ssl: true, compress: false)
|
29
44
|
@host = host
|
@@ -78,7 +93,7 @@ module Datadog
|
|
78
93
|
|
79
94
|
private
|
80
95
|
|
81
|
-
def perform_http_call(path:, payload:, headers:, verb:, retries: MAX_RETRIES, backoff: INITIAL_BACKOFF)
|
96
|
+
def perform_http_call(path:, payload:, headers:, verb:, retries: MAX_RETRIES, backoff: INITIAL_BACKOFF, retry_start_time: Core::Utils::Time.get_time)
|
82
97
|
response = nil
|
83
98
|
|
84
99
|
begin
|
@@ -98,12 +113,23 @@ module Datadog
|
|
98
113
|
else
|
99
114
|
return response
|
100
115
|
end
|
101
|
-
rescue
|
102
|
-
Datadog.logger.debug { "Failed to send request with #{e} (#{e.message})" }
|
103
|
-
|
116
|
+
rescue *NON_RETRIABLE_ERRORS => e
|
117
|
+
Datadog.logger.debug { "Failed to send request with non-retriable error #{e} (#{e.message})" }
|
118
|
+
return ErrorResponse.new(e)
|
119
|
+
rescue *RETRIABLE_ERRORS => e
|
120
|
+
Datadog.logger.debug { "Failed to send request with retriable error #{e} (#{e.message})" }
|
104
121
|
response = ErrorResponse.new(e)
|
105
122
|
end
|
106
123
|
|
124
|
+
# Check if we've exceeded the maximum retry time
|
125
|
+
elapsed_time_seconds = Core::Utils::Time.get_time - retry_start_time
|
126
|
+
if elapsed_time_seconds >= MAX_RETRY_TIME
|
127
|
+
Datadog.logger.debug(
|
128
|
+
"Failed to send request to #{path} after #{elapsed_time_seconds.round(2)} seconds (exceeded MAX_RETRY_TIME of #{MAX_RETRY_TIME}s)"
|
129
|
+
)
|
130
|
+
return response
|
131
|
+
end
|
132
|
+
|
107
133
|
if retries.positive? && backoff <= MAX_BACKOFF
|
108
134
|
sleep(backoff)
|
109
135
|
|
@@ -113,11 +139,12 @@ module Datadog
|
|
113
139
|
headers: headers,
|
114
140
|
verb: verb,
|
115
141
|
retries: retries - 1,
|
116
|
-
backoff: backoff * 2
|
142
|
+
backoff: backoff * 2,
|
143
|
+
retry_start_time: retry_start_time
|
117
144
|
)
|
118
145
|
else
|
119
|
-
Datadog.logger.
|
120
|
-
"Failed to send request after #{MAX_RETRIES - retries} retries (current backoff value #{backoff})"
|
146
|
+
Datadog.logger.debug(
|
147
|
+
"Failed to send request to #{path} after #{MAX_RETRIES - retries} retries (current backoff value #{backoff})"
|
121
148
|
)
|
122
149
|
|
123
150
|
response
|
data/lib/datadog/ci/version.rb
CHANGED
data/lib/datadog/ci/worker.rb
CHANGED
@@ -11,13 +11,12 @@ module Datadog
|
|
11
11
|
include Datadog::Core::Workers::Async::Thread
|
12
12
|
|
13
13
|
DEFAULT_SHUTDOWN_TIMEOUT = 60
|
14
|
-
DEFAULT_WAIT_TIMEOUT = 60
|
15
14
|
|
16
15
|
def stop(timeout = DEFAULT_SHUTDOWN_TIMEOUT)
|
17
16
|
join(timeout)
|
18
17
|
end
|
19
18
|
|
20
|
-
def wait_until_done(timeout =
|
19
|
+
def wait_until_done(timeout = nil)
|
21
20
|
join(timeout)
|
22
21
|
end
|
23
22
|
|