Skip to content

Disconnect Google HTTP client test responses - #12372

Open
AlexeyKuznetsov-DD wants to merge 2 commits into
masterfrom
alexeyk/close-google-http-client-test-responses
Open

Disconnect Google HTTP client test responses#12372
AlexeyKuznetsov-DD wants to merge 2 commits into
masterfrom
alexeyk/close-google-http-client-test-responses

Conversation

@AlexeyKuznetsov-DD

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Disconnects each synchronous Google HTTP client test response in a finally block after the callback and status code have been read.

Motivation

The synchronous V0 and V1 test helpers left HttpResponse instances open. On an abandoned reused connection, HttpURLConnection can transparently replay an idempotent GET, causing the test server to emit a second server trace for one logical client request.

Additional Notes

Failure evidence:

Condition failed with actual trace count 3 and expected trace count 2.

The unexpected traces contained two server spans with the same client-span parent. Transport logging showed the first reused connection being abandoned and the GET being replayed on a new connection, which is consistent with the missing response cleanup.

Validation:

./gradlew :dd-java-agent:instrumentation:google-http-client-1.19:forkedTest -PtestJvm=zulu8 --tests GoogleHttpClientV0ForkedTest --tests GoogleHttpClientV1ForkedTest --rerun-tasks
./gradlew :dd-java-agent:instrumentation:google-http-client-1.19:allTests -PtestJvm=zulu8 --rerun-tasks
./gradlew :dd-java-agent:instrumentation:google-http-client-1.19:spotlessCheck

Related instrumentation PRs: #914 and #2950.

Contributor Checklist

Jira ticket: N/A

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes inst: others All other instrumentations type: bug fix Bug fix labels Sep 2, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.83 s 14.77 s [-0.4%; +1.2%] (no difference)
startup:insecure-bank:tracing:Agent 13.60 s 13.69 s [-1.6%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 16.95 s 16.85 s [-0.4%; +1.5%] (no difference)
startup:petclinic:iast:Agent 16.83 s 16.98 s [-1.8%; -0.0%] (maybe better)
startup:petclinic:profiling:Agent 16.68 s 16.55 s [-0.4%; +1.9%] (no difference)
startup:petclinic:sca:Agent 16.86 s 16.74 s [-0.3%; +1.7%] (no difference)
startup:petclinic:tracing:Agent 16.06 s 16.18 s [-1.6%; +0.1%] (no difference)

Commit: 539a0af4 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD marked this pull request as ready for review September 4, 2026 00:02
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from a team as a code owner September 4, 2026 00:02
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested review from jordan-wong and removed request for a team September 4, 2026 00:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T00:04:41.329143Z 539a0af Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

More details

The new finally block disconnects each response after normal processing. It also disconnects the response when the callback or status-code read throws.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 539a0af · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: others All other instrumentations tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant