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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64b3da927cc62294a16d73045c2585a0d943d81d638b9ac61f95f10b2f69f6b6
4
- data.tar.gz: 72451663fb18398c49bfa61ac43b0317e21792853d2681b44e77239e932d1bfc
3
+ metadata.gz: 1460c3b89178f919bb71b356889f177c36f74ac11a8770f71e57eeebcd7215ff
4
+ data.tar.gz: 37d0ede02d7851e074287b465968aa36d8db4ad078329553b29b3f1eff7d76d9
5
5
  SHA512:
6
- metadata.gz: 209a3a9d3c6c6081b864231e0c63742f34c5ba64b51c60e879742410a3da16bac7eefc802dd18a23bed30f9cdc4be0282258d51c28fdac560792a91423acaef7
7
- data.tar.gz: 13bb63efb8388ac57a396c299fc5d36f8bda7889914c31cee7eacc409a4bbf9fad70e96e7b01b8ce2cf2139fd467f8f1dda21fe7090e826958440e701abbcfdc
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.0...main
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
@@ -35,7 +35,7 @@ module Datadog
35
35
  # launch configuration workers
36
36
  configuration_workers.each(&:perform)
37
37
 
38
- # block until all workers are done (or 60 seconds has passed)
38
+ # block until all workers are done
39
39
  configuration_workers.each(&:wait_until_done)
40
40
  end
41
41
 
@@ -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 Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, SocketError, Net::HTTPBadResponse => e
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.error(
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
@@ -5,7 +5,7 @@ module Datadog
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 22
8
- PATCH = 0
8
+ PATCH = 1
9
9
  PRE = nil
10
10
  BUILD = nil
11
11
  # PRE and BUILD above are modified for dev gems during gem build GHA workflow
@@ -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 = DEFAULT_WAIT_TIMEOUT)
19
+ def wait_until_done(timeout = nil)
21
20
  join(timeout)
22
21
  end
23
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog-ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.0
4
+ version: 1.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.