Skip to content

feat: emit TaskBlock events for native socket I/O#666

Draft
kaahos wants to merge 17 commits into
mainfrom
paul.fournillon/taskblock-native-io
Draft

feat: emit TaskBlock events for native socket I/O#666
kaahos wants to merge 17 commits into
mainfrom
paul.fournillon/taskblock-native-io

Conversation

@kaahos

@kaahos kaahos commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?:

Adds native socket I/O TaskBlock instrumentation on Linux by interposing blocking socket APIs, classifying socket file descriptors, and recording synchronous TaskBlock events for owned native I/O waits.

Motivation:

Blocking native I/O is a major source of wall-clock time. Recording these intervals directly avoids intentionally signaling threads while they are blocked in recognized socket operations.

Additional Notes:

This PR includes Linux native interposition, socket/Fd classification, lifecycle handling for unloadable libraries, integration tests, and a native socket I/O benchmark.

How to test the change?:

Automated coverage includes native unit tests for interposition, socket sampling, native block handling, thread-filter suppression, and Java integration tests for native socket TaskBlock behavior.

  • ./.claude/commands/build-and-summarize testDebug

Native socket integration tests are Linux-specific and skip on macOS.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a security review (run the dd:platform-security-review skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: [JIRA-XXXX]

@datadog-datadog-prod-us1

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #29573019248 | Commit: 47a49dd | Duration: 16m 20s (longest job)

All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - -
8-ibm - - -
8-j9 - -
8-librca - -
8-orcl - - -
11 - - -
11-j9 - -
11-librca - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
21 - -
21-graal - -
21-librca - -
25 - -
25-graal - -
25-librca - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-07-17 10:37:48 UTC

@kaahos
kaahos force-pushed the paul.fournillon/taskblock-native-io branch 2 times, most recently from cfa4870 to 7f00fae Compare July 16, 2026 15:29
@kaahos
kaahos force-pushed the paul.fournillon/taskblock-native-io branch 2 times, most recently from a4f7ef8 to 5de84e2 Compare July 17, 2026 08:36
@kaahos
kaahos force-pushed the paul.fournillon/taskblock-native-io branch from 5de84e2 to c4a2496 Compare July 17, 2026 09:44
@dd-octo-sts

dd-octo-sts Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 4077c10)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/125241502 Commit: 4077c10d812d39470e41a46ffb6dd02dfe10ae05

⚠️ Significant outliers

  • 🟢 future-genetic (JDK 25): runtime -3.2% (2072→2005 ms)
Runtime details (per benchmark × JDK)
Benchmark JDK Latest Dev Δ (dev vs latest) Issues L/D
akka-uct 21 ✅ 10318 ms (21 iters) ✅ 10297 ms (21 iters) ≈ -0.2% (±11.5%) — / —
akka-uct 25 ✅ 8877 ms (24 iters) ✅ 8872 ms (24 iters) ≈ -0.1% (±10%) — / —
finagle-chirper 21 ✅ 5924 ms (33 iters) ✅ 6023 ms (33 iters) ≈ +1.7% (±25.7%) ⚠️ W:3 / ⚠️ W:3
finagle-chirper 25 ✅ 5440 ms (36 iters) ✅ 5447 ms (36 iters) ≈ +0.1% (±24%) ⚠️ W:3 / ⚠️ W:3
fj-kmeans 25 ✅ 2819 ms (66 iters) ✅ 2768 ms (68 iters) ≈ -1.8% (±2.7%) — / —
future-genetic 21 ✅ 2100 ms (89 iters) ✅ 2118 ms (87 iters) ≈ +0.9% (±2.8%) — / —
future-genetic 25 ✅ 2072 ms (89 iters) ✅ 2005 ms (93 iters) 🟢 -3.2% — / —
naive-bayes 25 ✅ 990 ms (172 iters) ✅ 1017 ms (169 iters) ≈ +2.7% (±31.9%) — / —
reactors 21 ✅ 16610 ms (15 iters) ✅ 16761 ms (15 iters) ≈ +0.9% (±8%) — / —
reactors 25 ✅ 18536 ms (15 iters) ✅ 18473 ms (15 iters) ≈ -0.3% (±2.8%) — / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

Benchmark JDK Dropped rec Dropped jvmti Dropped trace Skipped WC AGCT fail Unwind fail
akka-uct 21 ✅ / ✅ ✅ / ✅ ✅ / 1 2000 / 2002 ✅ / ✅ ✅ / ✅
akka-uct 25 ✅ / ✅ ✅ / ✅ 1 / 4 2240 / 2285 ✅ / ✅ ✅ / ✅
finagle-chirper 21 ✅ / ✅ ✅ / ✅ 3 / 4 8783 / 8895 ✅ / ✅ ✅ / ✅
finagle-chirper 25 ✅ / ✅ ✅ / ✅ 2 / 3 8381 / 7985 ✅ / ✅ ✅ / ✅
fj-kmeans 21 ✅ / ✅ ✅ / ✅ 4 / ✅ 1321 / ✅ ✅ / ✅ ✅ / ✅
fj-kmeans 25 ✅ / ✅ ✅ / ✅ 2 / 3 1268 / 1276 ✅ / ✅ ✅ / ✅
future-genetic 21 ✅ / ✅ ✅ / ✅ ✅ / 2 2969 / 2966 ✅ / ✅ ✅ / ✅
future-genetic 25 ✅ / ✅ ✅ / ✅ 3 / 1 2828 / 2888 ✅ / ✅ ✅ / ✅
naive-bayes 21 ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅
naive-bayes 25 ✅ / ✅ ✅ / ✅ 1 / 4 3471 / 3500 ✅ / ✅ ✅ / ✅
reactors 21 ✅ / ✅ ✅ / ✅ ✅ / 1 1675 / 1607 ✅ / ✅ ✅ / ✅
reactors 25 ✅ / ✅ ✅ / ✅ 1 / ✅ 1935 / 1843 ✅ / ✅ ✅ / ✅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant