Repository navigation
Conversation
…candidate Evaluated as part of the APMLP-1895 scan for ClassLatch candidates: buildHttpClient runs once per component (writer, telemetry, profiling, etc.), not per request, and the shaded agent jar relocates okhttp3 entirely, so this catch can never fire outside this module's own unshaded test builds. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
|
Closing — the catch here only fires in this module's own unshaded test builds (okhttp3 is relocated to datadog.okhttp3 in the shaded agent jar), so there's no real per-class repeated-failure cost in production to amortize with ClassLatch. Leaving the plain catch in place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of the APMLP-1895 scan for sites that could benefit from
ClassLatch(#12702, unmerged — this PR is stacked on it). EvaluatedOkHttpUtils.buildHttpClient'scatch (NoSuchMethodError e)aroundeventListenerFactory(...)and concluded it's not a good candidate, for two independent reasons confirmed in code:buildHttpClientis called once per component construction (writer, telemetry client, profiling uploader, crash uploader, AI Guard, etc.), never per request. There's no repeated-failure-per-class cost to amortize.dd-java-agent/build.gradlerelocates the entireokhttp3package todatadog.okhttp3in the shaded agent jar. In a real deployed agent there is nookhttp3classpath collision possible at all — the catch can only ever fire in this module's own unshaded test builds, where a different okhttp3 version can land on the test classpath.No behavior change. Added a short comment documenting the evaluation so this doesn't get re-flagged by a future scan.
Test plan
./gradlew spotlessApply./gradlew :communication:test --tests "*OkHttpUtils*"— pass (default, JDK 8, JDK 11)🤖 Generated with Claude Code