Skip to content

Upgrade JNR Unixsocket to 0.39.6 - #13014

Draft
mcculls wants to merge 1 commit into
masterfrom
mcculls/jnr-unixsocket-0.39.6
Draft

mcculls wants to merge 1 commit into
masterfrom
mcculls/jnr-unixsocket-0.39.6

Conversation

@mcculls

@mcculls mcculls commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Upgrade jnr-unixsocket from 0.38.25 to 0.39.6, including its JNR/JFFI dependencies and 487 affected lockfiles. Add the no-op PatchLogger.finest(Supplier<String>) overload required by the shaded JFFI StubLoader, with regression coverage ensuring suppliers are not evaluated.

Exclude JNR constant tables and FFI aliases for unsupported native platforms, preserving supported-platform tables, fallbacks, and classes referenced by shared factories.

Remove JNR's transitive ASM dependencies centrally and supply the catalog-controlled ASM 9.10.1 bundle explicitly. Include ASM utilities and analysis previously supplied transitively by JNR. This prevents ASM 9.11.1 helpers from referencing LimitExceededException, which is absent from the ASM core embedded in dd-instrument-java.

Motivation

Pick up Unix datagram shutdown and address-handling fixes, native-library loading improvements, and transitive dependency updates while preserving agent logging isolation, ASM compatibility, and the agent JAR size budget.

Additional Notes

The rebuilt agent JAR is 34,530,363 bytes (32.93 MiB), below the 34 MiB budget.

Validation passed:

  • spotlessApply and git diff --check.
  • Debugger smoke test InProductEnablementIntegrationTest.testDynamicInstrumentationResetEnablement, previously failing with the ASM mismatch.
  • All 13 socket-utils tests and 91 metrics-lib tests.
  • Full agent build and verifyAgentJarContents, including size and structural checks.
  • Source and bytecode audit of JNR-FFI 2.3.4 and JFFI 1.4.3: all 40 direct ASM method/constructor references across 13 JNR-FFI classes resolve against both ASM 9.10.1 and the shaded agent copy; JFFI has no ASM references. JNR uses the ASM4 visitor API and generates Java 5/8 class files, with no ASM 9.11-only API calls.
  • Native harness on Java 8 and 25 using the exact shared classes/resources extracted from the built agent, with ASM generation and debug verification enabled: libc primitive/string calls, struct arguments, native callbacks, and generated variable accessors passed. Reflective class tracing/checking helpers resolve. JNR's optional legacy TraceMethodVisitor(MethodVisitor) constructor lookup falls back as designed; that constructor is absent in both ASM 9.10.1 and 9.11.1.
  • Dependency resolution for JNR-consuming configurations; all five ASM modules in the agent shared classpath resolve to 9.10.1. Lockfile refresh changes only ASM entries.

Earlier validation of the JNR upgrade also covered PatchLoggerTest, shaded JFFI loading and native Unix socket creation, retained-class reference audits of the excluded platform classes, and reflective platform-selector checks. Those selector checks simulate platform profiles; they are not native execution on every platform.

The token-gated Akka HTTP 10.6 module is excluded from the local build. Its lockfile was aligned manually with the verified dependency versions and was not independently resolved.

Contributor Checklist

  • Imperative title and required labels.
  • Updated affected dependency lockfiles.
  • Added regression coverage for the logger patch.

@mcculls mcculls added comp: core Tracer core tag: no release notes Changes to exclude from release notes type: refactoring tag: dependencies Dependencies related changes tag: ai generated Largely based on code generated by an AI or LLM labels Oct 23, 2026
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.85% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f696271 | Docs | Give us feedback!

@mcculls
mcculls force-pushed the mcculls/jnr-unixsocket-0.39.6 branch from e387ab8 to e0811af Compare October 23, 2026 12:46
@pr-commenter

pr-commenter Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1792765205 1792765546
end_time 2026-10-23T14:21:33 2026-10-23T14:27:13
git_branch master mcculls/jnr-unixsocket-0.39.6
git_commit_sha 54903d7 f696271
start_time 2026-10-23T14:20:06 2026-10-23T14:25:47
See matching parameters
Baseline Candidate
ci_job_id 2170572060 2170572060
ci_pipeline_id 147079679 147079679
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1792764289 1792764289

Summary

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

scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:basic better
[-15.610µs; -3.476µs] or [-5.151%; -1.147%]
unsure
[-15.395µs; -2.833µs] or [-4.679%; -0.861%]
unsure
[-15.853µs; -2.359µs] or [-4.686%; -0.697%]
unstable
[-147.440µs; +81.018µs] or [-13.742%; +7.551%]
unstable
[-114.471op/s; +220.179op/s] or [-5.037%; +9.688%]
scenario:loop better
[-1.442ms; -1.158ms] or [-16.364%; -13.142%]
better
[-1.478ms; -1.193ms] or [-16.595%; -13.398%]
better
[-1.484ms; -1.197ms] or [-16.586%; -13.383%]
better
[-1.450ms; -1.141ms] or [-16.052%; -12.634%]
better
[+15.851op/s; +20.425op/s] or [+14.187%; +18.281%]
See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-53.729µs; +34.642µs] or [-16.414%; +10.583%]
unstable
[-68.096µs; +46.756µs] or [-18.750%; +12.874%]
unstable
[-84.901µs; +58.587µs] or [-22.251%; +15.355%]
unstable
[-442.892µs; +258.746µs] or [-34.524%; +20.169%]
same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (363.18 µs) : 299, 427
.   : milestone, 363,
basic (328.996 µs) : 323, 335
.   : milestone, 329,
loop (8.907 ms) : 8720, 9094
.   : milestone, 8907,
section candidate
noprobe (352.51 µs) : 310, 395
.   : milestone, 353,
basic (319.882 µs) : 314, 326
.   : milestone, 320,
loop (7.571 ms) : 7565, 7577
.   : milestone, 7571,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 363.18 µs [299.091 µs, 427.269 µs]
basic 328.996 µs [322.647 µs, 335.345 µs]
loop 8.907 ms [8.72 ms, 9.094 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 352.51 µs [309.529 µs, 395.491 µs]
basic 319.882 µs [314.02 µs, 325.744 µs]
loop 7.571 ms [7.565 ms, 7.577 ms]

@mcculls
mcculls force-pushed the mcculls/jnr-unixsocket-0.39.6 branch from e0811af to bcb2ae4 Compare October 23, 2026 13:09
@dd-octo-sts

dd-octo-sts Bot commented Oct 23, 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 13.97 s 13.92 s [-0.4%; +1.1%] (no difference)
startup:insecure-bank:tracing:Agent 12.86 s 12.93 s [-1.2%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.18 s 16.99 s [+0.2%; +1.9%] (maybe worse)
startup:petclinic:iast:Agent 17.08 s 17.07 s [-0.8%; +0.9%] (no difference)
startup:petclinic:profiling:Agent 16.91 s 16.74 s [-0.4%; +2.3%] (no difference)
startup:petclinic:sca:Agent 17.12 s 17.14 s [-0.9%; +0.7%] (no difference)
startup:petclinic:tracing:Agent 16.27 s 15.71 s [-0.8%; +8.0%] (no difference)

Commit: f696271c · 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.

@pr-commenter

pr-commenter Bot commented Oct 23, 2026

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/jnr-unixsocket-0.39.6
git_commit_date 1792748817 1792760790
git_commit_sha 79a425a bcb2ae4
See matching parameters
Baseline Candidate
ci_job_date 1792762274 1792762274
ci_job_id 2170230426 2170230426
ci_pipeline_id 147056621 147056621
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-s8ruol9p 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-s8ruol9p 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

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

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce same

Update the JNR dependency stack and affected lockfiles. Add the no-op
PatchLogger finest(Supplier<String>) overload required by the shaded JFFI
StubLoader, with regression coverage ensuring lazy messages remain unevaluated.

Trim unsupported JNR platform classes. Exclude JNR's transitive ASM dependencies
and supply the controlled ASM 9.10.1 bundle, including utilities and analysis,
to remain compatible with the core embedded in dd-instrument-java.
@pr-commenter

pr-commenter Bot commented Oct 23, 2026

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/jnr-unixsocket-0.39.6
git_commit_date 1792748817 1792760790
git_commit_sha 79a425a bcb2ae4
See matching parameters
Baseline Candidate
ci_job_date 1792762216 1792762216
ci_job_id 2170230429 2170230429
ci_pipeline_id 147056621 147056621
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-zdp988g5 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-zdp988g5 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

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

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume unsure
[+347.728op/s; +9416.481op/s] or [+0.190%; +5.144%]

@mcculls
mcculls force-pushed the mcculls/jnr-unixsocket-0.39.6 branch from bcb2ae4 to f696271 Compare October 23, 2026 14:08
Comment on lines +95 to +96
// JNR must use our controlled ASM version, matching the core embedded in dd-instrument-java.
dependencies.components.withModule('com.github.jnr:jnr-ffi') {

@bric3 bric3 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: I'll document that using this mechanism edits the dependency metadata before resolution.

Suggested change
// JNR must use our controlled ASM version, matching the core embedded in dd-instrument-java.
dependencies.components.withModule('com.github.jnr:jnr-ffi') {
// JNR must use our controlled ASM version, matching the core embedded in dd-instrument-java.
// The following edits JNR-FFI's dependency metadata before resolution to remove ASM.
dependencies.components.withModule('com.github.jnr:jnr-ffi') {

This branch has not been deployed

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

Labels

comp: core Tracer core tag: ai generated Largely based on code generated by an AI or LLM tag: dependencies Dependencies related changes tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants