Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try requiring ostruct explicitly to fix missing OpenStruct exception #4126

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

p-datadog
Copy link
Member

@p-datadog p-datadog commented Nov 18, 2024

What does this PR do?

Tries to fix failing CI due to missing OpenStruct.

Motivation:
Example error:

  1) Datadog::Core::Remote::Transport::HTTP.v7 #send_config 
253
     Failure/Error:
254
       OpenStruct.new(
255
         {
256
           root_version: 1,              # unverified mode, so 1
257
           targets_version: 0,           # from scratch, so zero
258
           config_states: [],            # from scratch, so empty
259
           has_error: false,             # from scratch, so false
260
           error: '',                    # from scratch, so blank
261
           opaque_backend_state: '',     # from scratch, so blank
262
         }
263
       )
264

265
     NameError:
266
       uninitialized constant OpenStruct
267
     # ./spec/datadog/core/remote/transport/http_spec.rb:95:in `block (4 levels) in <top (required)>'
268
     # ./spec/datadog/core/remote/transport/http_spec.rb:126:in `block (4 levels) in <top (required)>'
269
     # ./spec/datadog/core/remote/transport/http_spec.rb:204:in `block (4 levels) in <top (required)>'
270
     # ./spec/datadog/core/remote/transport/http_spec.rb:209:in `block (4 levels) in <top (required)>'
271
     # ./spec/spec_helper.rb:237:in `block (2 levels) in <top (required)>'
272
     # ./spec/spec_helper.rb:122:in `block (2 levels) in <top (required)>'

Change log entry

None

Additional Notes:

How to test the change?

@p-datadog p-datadog requested a review from a team as a code owner November 18, 2024 14:27
@github-actions github-actions bot added the dev/testing Involves testing processes (e.g. RSpec) label Nov 18, 2024
@p-datadog
Copy link
Member Author

This PR failed in a DI test which I will investigate:


849
  1) Instrumentation integration log probe line probe simple log probe target line contains a comment (no executable code) installs probe
850
     Failure/Error: raise Error::AgentCommunicationError, "#{desc} failed: #{exc.class}: #{exc}"
851

852
     Datadog::DI::Error::AgentCommunicationError:
853
       Probe status submission failed: Errno::ECONNREFUSED: Failed to open TCP connection to :80 (Connection refused - connect(2) for nil port 80)
854
     # ./lib/datadog/di/transport.rb:76:in `rescue in send_request'
855
     # ./lib/datadog/di/transport.rb:61:in `send_request'
856
     # ./lib/datadog/di/transport.rb:41:in `send_diagnostics'
857
     # ./lib/datadog/di/probe_notifier_worker.rb:238:in `public_send'
858
     # ./lib/datadog/di/probe_notifier_worker.rb:238:in `block (2 levels) in <class:ProbeNotifierWorker>'
859
     # ./lib/datadog/di/probe_notifier_worker.rb:266:in `maybe_send'
860
     # ./lib/datadog/di/probe_notifier_worker.rb:76:in `block (2 levels) in start'
861
     # ./lib/datadog/di/probe_notifier_worker.rb:49:in `loop'
862
     # ./lib/datadog/di/probe_notifier_worker.rb:49:in `block in start'
863
     # ./spec/spec_helper.rb:253:in `block in initialize'
864
     # ------------------
865
     # --- Caused by: ---
866
     # Errno::ECONNREFUSED:
867
     #   Connection refused - connect(2) for nil port 80
868
     #   ./lib/datadog/core/transport/http/adapters/net.rb:39:in `open'
869

870
Finished in 1 minute 0.43 seconds (files took 3.49 seconds to load)
871
4890 examples, 1 failure, 214 pending
872

873
Failed examples:
874

875
rspec ./spec/datadog/di/integration/instrumentation_spec.rb:546 # Instrumentation integration log probe line probe simple log probe target line contains a comment (no executable code) installs probe
876

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.78%. Comparing base (8015804) to head (7bb95c1).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4126      +/-   ##
==========================================
+ Coverage   97.77%   97.78%   +0.01%     
==========================================
  Files        1350     1350              
  Lines       81262    81263       +1     
  Branches     4108     4108              
==========================================
+ Hits        79452    79463      +11     
+ Misses       1810     1800      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@p-datadog p-datadog added the dev/internal Other internal work that does not need to be included in the changelog label Nov 18, 2024
@pr-commenter
Copy link

pr-commenter bot commented Nov 18, 2024

Benchmarks

Benchmark execution time: 2024-11-18 15:07:07

Comparing candidate commit 7bb95c1 in PR branch openstruct-fix with baseline commit 8015804 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 29 metrics, 2 unstable metrics.

@p-datadog p-datadog merged commit 4b7a466 into master Nov 18, 2024
270 checks passed
@p-datadog p-datadog deleted the openstruct-fix branch November 18, 2024 15:09
@github-actions github-actions bot added this to the 2.8.0 milestone Nov 18, 2024
p-datadog pushed a commit that referenced this pull request Nov 18, 2024
…7af82148d6f2' into HEAD

* di-transport-fix:
  span and trace ids need to be stringified
  Require ostruct explicitly to fix missing OpenStruct exception (#4126)
  DEBUG-2334 correctly serialize debugger input payloads

* commit 'c5d3e33327c277bd7fd7b9cb5a6b7af82148d6f2':
  Require ostruct explicitly to fix missing OpenStruct exception (#4126)
  permit exact matches of relative paths for untargeted line trace points
  fix untargeted trace point configuration for DI benchmark
  DEBUG-2334 enable dynamic instrumentation line probe benchmarks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/internal Other internal work that does not need to be included in the changelog dev/testing Involves testing processes (e.g. RSpec)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants