Skip to content

feat: emit TaskBlock events for JVM blocking states#665

Draft
kaahos wants to merge 12 commits into
mainfrom
paul.fournillon/taskblock-jvm-producers
Draft

feat: emit TaskBlock events for JVM blocking states#665
kaahos wants to merge 12 commits into
mainfrom
paul.fournillon/taskblock-jvm-producers

Conversation

@kaahos

@kaahos kaahos commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?:

Adds JVM TaskBlock producers for LockSupport.park and monitor contention/wait states, wiring JVM state transitions into the synchronous TaskBlock recording API.

Motivation:

Common JVM blocking operations can be represented as TaskBlock events instead of relying on wall-clock signals against blocked threads.

Additional Notes:

Virtual threads are not explicitly emitted by this PR. This change focuses on platform-thread JVM blocking states exposed through the existing VM entry paths.

How to test the change?:

Automated coverage includes native park-state tests and Java integration tests for park, monitor wait, monitor contention, JVMTI-backed variants, and combined wall-clock mitigation behavior.

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

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]

@dd-octo-sts

dd-octo-sts Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #29571012127 | Commit: 4d61bb0 | Duration: 16m 43s (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:05:16 UTC

@kaahos
kaahos force-pushed the paul.fournillon/taskblock-jvm-producers branch 2 times, most recently from 1beeda2 to 38efbf8 Compare July 16, 2026 15:20
@dd-octo-sts

dd-octo-sts Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 38efbf8)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/125051342 Commit: 38efbf8f7d94004f2ec282bc6c50148a99f67616

⚠️ Significant outliers

  • 🔴 fj-kmeans (JDK 21): runtime +4.1% (2719→2830 ms)
  • 🔴 fj-kmeans (JDK 25): runtime +2.8% (2737→2815 ms)
Runtime details (per benchmark × JDK)
Benchmark JDK Latest Dev Δ (dev vs latest) Issues L/D
akka-uct 21 ✅ 10365 ms (21 iters) ✅ 10195 ms (21 iters) ≈ -1.6% (±11.4%) — / —
akka-uct 25 ✅ 8859 ms (24 iters) ✅ 8925 ms (24 iters) ≈ +0.7% (±10.1%) — / —
finagle-chirper 21 ✅ 5945 ms (33 iters) ✅ 5953 ms (33 iters) ≈ +0.1% (±24.9%) ⚠️ W:3 / ⚠️ W:3
finagle-chirper 25 ✅ 5495 ms (36 iters) ✅ 5431 ms (36 iters) ≈ -1.2% (±24.2%) ⚠️ W:3 / ⚠️ W:3
fj-kmeans 21 ✅ 2719 ms (68 iters) ✅ 2830 ms (66 iters) 🔴 +4.1% — / —
fj-kmeans 25 ✅ 2737 ms (68 iters) ✅ 2815 ms (66 iters) 🔴 +2.8% — / —
future-genetic 21 ✅ 2114 ms (88 iters) ✅ 2140 ms (87 iters) ≈ +1.2% (±2.7%) — / —
future-genetic 25 ✅ 2080 ms (90 iters) ✅ 2126 ms (88 iters) ≈ +2.2% (±2.5%) — / —
naive-bayes 21 ✅ 1299 ms (131 iters) ✅ 1232 ms (139 iters) ≈ -5.2% (±31.9%) — / —
naive-bayes 25 ✅ 997 ms (172 iters) ✅ 1004 ms (170 iters) ≈ +0.7% (±31.8%) — / —
reactors 21 ✅ 16202 ms (15 iters) ✅ 15908 ms (15 iters) ≈ -1.8% (±7.6%) — / —
reactors 25 ✅ 18524 ms (15 iters) ✅ 18484 ms (15 iters) ≈ -0.2% (±3.9%) — / —
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 ✅ / ✅ ✅ / ✅ 2 / ✅ 2045 / 1958 ✅ / ✅ ✅ / ✅
akka-uct 25 ✅ / ✅ ✅ / ✅ ✅ / 3 2353 / 2059 ✅ / ✅ ✅ / ✅
finagle-chirper 21 ✅ / ✅ ✅ / ✅ 6 / 2 8437 / 8382 ✅ / ✅ ✅ / ✅
finagle-chirper 25 ✅ / ✅ ✅ / ✅ ✅ / 2 8800 / 8439 ✅ / ✅ ✅ / ✅
fj-kmeans 21 ✅ / ✅ ✅ / ✅ 2 / 2 1248 / 1279 ✅ / ✅ ✅ / ✅
fj-kmeans 25 ✅ / ✅ ✅ / ✅ 4 / 1 1262 / 1271 ✅ / ✅ ✅ / ✅
future-genetic 21 ✅ / ✅ ✅ / ✅ ✅ / ✅ 2963 / 2980 ✅ / ✅ ✅ / ✅
future-genetic 25 ✅ / ✅ ✅ / ✅ 2 / 3 2955 / 2936 ✅ / ✅ ✅ / ✅
naive-bayes 21 ✅ / ✅ ✅ / ✅ 3 / 7 3466 / 3539 ✅ / ✅ ✅ / ✅
naive-bayes 25 ✅ / ✅ ✅ / ✅ 5 / 1 3478 / 3531 ✅ / ✅ ✅ / ✅
reactors 21 ✅ / ✅ ✅ / ✅ ✅ / ✅ 1700 / 1609 ✅ / ✅ ✅ / ✅
reactors 25 ✅ / ✅ ✅ / ✅ ✅ / ✅ 1905 / 1873 ✅ / ✅ ✅ / ✅

@dd-octo-sts

dd-octo-sts Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Reliability & Chaos Results

All reliability & chaos checks passed Pipeline: https://gitlab.ddbuild.io/DataDog/java-profiler/-/pipelines/125035442

@kaahos
kaahos force-pushed the paul.fournillon/taskblock-jvm-producers branch from 38efbf8 to cdb8274 Compare July 16, 2026 22:13
@dd-octo-sts

dd-octo-sts Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (commit cdb8274)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/125162043 Commit: cdb8274124fc1947560c5c91bbf213a248e6b608

⚠️ Significant outliers

  • 🔴 fj-kmeans (JDK 21): runtime +5.1% (2683→2821 ms)
Runtime details (per benchmark × JDK)
Benchmark JDK Latest Dev Δ (dev vs latest) Issues L/D
finagle-chirper 21 ✅ 5956 ms (33 iters) ✅ 6031 ms (33 iters) ≈ +1.3% (±24.8%) ⚠️ W:3 / ⚠️ W:3
finagle-chirper 25 ✅ 5457 ms (36 iters) ✅ 5444 ms (36 iters) ≈ -0.2% (±23.9%) ⚠️ W:3 / ⚠️ W:3
fj-kmeans 21 ✅ 2683 ms (70 iters) ✅ 2821 ms (66 iters) 🔴 +5.1% — / —
fj-kmeans 25 ✅ 2786 ms (67 iters) ✅ 2839 ms (66 iters) ≈ +1.9% (±2.7%) — / —
future-genetic 21 ✅ 2063 ms (90 iters) ✅ 2095 ms (89 iters) ≈ +1.6% (±2.6%) — / —
future-genetic 25 ✅ 2072 ms (90 iters) ✅ 2125 ms (87 iters) ≈ +2.6% (±2.6%) — / —
naive-bayes 21 ✅ 1257 ms (135 iters) ✅ 1250 ms (136 iters) ≈ -0.6% (±32.8%) — / —
reactors 21 ✅ 16137 ms (15 iters) ✅ 15974 ms (15 iters) ≈ -1% (±7.5%) — / —
reactors 25 ✅ 18395 ms (15 iters) ✅ 18505 ms (15 iters) ≈ +0.6% (±4.4%) — / —
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 ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅
akka-uct 25 ✅ / ✅ ✅ / ✅ 1 / 1 2260 / 2182 ✅ / ✅ ✅ / ✅
finagle-chirper 21 ✅ / ✅ ✅ / ✅ 4 / 3 8741 / 8673 ✅ / ✅ ✅ / ✅
finagle-chirper 25 ✅ / ✅ ✅ / ✅ 1 / ✅ 8238 / 8373 ✅ / ✅ ✅ / ✅
fj-kmeans 21 ✅ / ✅ ✅ / ✅ 4 / 2 1241 / 1256 ✅ / ✅ ✅ / ✅
fj-kmeans 25 ✅ / ✅ ✅ / ✅ 2 / ✅ 1287 / 1282 ✅ / ✅ ✅ / ✅
future-genetic 21 ✅ / ✅ ✅ / ✅ 2 / 1 2971 / 2981 ✅ / ✅ ✅ / ✅
future-genetic 25 ✅ / ✅ ✅ / ✅ 1 / 1 2968 / 2956 ✅ / ✅ ✅ / ✅
naive-bayes 21 ✅ / ✅ ✅ / ✅ 5 / 3 3468 / 3474 ✅ / ✅ ✅ / ✅
naive-bayes 25 ✅ / ✅ ✅ / ✅ 9 / 3 3464 / 3465 ✅ / ✅ ✅ / ✅
reactors 21 ✅ / ✅ ✅ / ✅ 1 / 2 1531 / 1536 ✅ / ✅ ✅ / ✅
reactors 25 ✅ / ✅ ✅ / ✅ 1 / ✅ 1857 / 1856 ✅ / ✅ ✅ / ✅

@dd-octo-sts

dd-octo-sts Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (commit e13ec27)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/125211559 Commit: e13ec275311412f74c94ccb558f2c544418a0634

✅ Within expected boundaries

No significant runtime deltas (all within run-to-run noise) and no internal-counter outliers.

Runtime details (per benchmark × JDK)
Benchmark JDK Latest Dev Δ (dev vs latest) Issues L/D
akka-uct 21 ✅ 10495 ms (21 iters) ✅ 10316 ms (21 iters) ≈ -1.7% (±10.8%) — / —
akka-uct 25 ✅ 8849 ms (24 iters) ✅ 8938 ms (24 iters) ≈ +1% (±10.2%) — / —
finagle-chirper 21 ✅ 5936 ms (33 iters) ✅ 5938 ms (33 iters) ≈ +0% (±24.9%) ⚠️ W:3 / ⚠️ W:3
finagle-chirper 25 ✅ 5534 ms (36 iters) ✅ 5474 ms (36 iters) ≈ -1.1% (±24.5%) ⚠️ W:3 / ⚠️ W:4
fj-kmeans 21 ✅ 2773 ms (67 iters) ✅ 2775 ms (67 iters) ≈ +0.1% (±2.7%) — / —
fj-kmeans 25 ✅ 2803 ms (66 iters) ✅ 2840 ms (66 iters) ≈ +1.3% (±2.6%) — / —
future-genetic 21 ✅ 2090 ms (89 iters) ✅ 2093 ms (89 iters) ≈ +0.1% (±2.7%) — / —
future-genetic 25 ✅ 2086 ms (89 iters) ✅ 2118 ms (87 iters) ≈ +1.5% (±2.4%) — / —
naive-bayes 21 ✅ 1251 ms (136 iters) ✅ 1268 ms (135 iters) ≈ +1.4% (±33.1%) — / —
naive-bayes 25 ✅ 1016 ms (169 iters) ✅ 1028 ms (166 iters) ≈ +1.2% (±31.8%) — / —
reactors 25 ✅ 18334 ms (15 iters) ✅ 18614 ms (15 iters) ≈ +1.5% (±4.6%) — / —
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 ✅ / ✅ ✅ / ✅ 2 / 1 1924 / 1980 ✅ / ✅ ✅ / ✅
akka-uct 25 ✅ / ✅ ✅ / ✅ 4 / 2 2127 / 2360 ✅ / ✅ ✅ / ✅
finagle-chirper 21 ✅ / ✅ ✅ / ✅ 4 / 3 8378 / 8654 ✅ / ✅ ✅ / ✅
finagle-chirper 25 ✅ / ✅ ✅ / ✅ 1 / ✅ 8670 / 8433 ✅ / ✅ ✅ / ✅
fj-kmeans 21 ✅ / ✅ ✅ / ✅ ✅ / ✅ 1259 / 1251 ✅ / ✅ ✅ / ✅
fj-kmeans 25 ✅ / ✅ ✅ / ✅ 1 / 4 1288 / 1264 ✅ / ✅ ✅ / ✅
future-genetic 21 ✅ / ✅ ✅ / ✅ 1 / 4 2942 / 2917 ✅ / ✅ ✅ / ✅
future-genetic 25 ✅ / ✅ ✅ / ✅ 1 / 1 2898 / 2871 ✅ / ✅ ✅ / ✅
naive-bayes 21 ✅ / ✅ ✅ / ✅ 4 / 1 3492 / 3510 ✅ / ✅ ✅ / ✅
naive-bayes 25 ✅ / ✅ ✅ / ✅ 1 / 3 3496 / 3479 ✅ / ✅ ✅ / ✅
reactors 21 ✅ / ✅ ✅ / ✅ ✅ / 2 1858 / 1656 ✅ / ✅ ✅ / ✅
reactors 25 ✅ / ✅ ✅ / ✅ 1 / ✅ 1890 / 1893 ✅ / ✅ ✅ / ✅

@kaahos
kaahos force-pushed the paul.fournillon/taskblock-jvm-producers branch from e13ec27 to c111812 Compare July 17, 2026 09:43
@dd-octo-sts

dd-octo-sts Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (commit c111812)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/125236325 Commit: c11181224884586f33d98ba19aa41e6162ecf5f2

✅ Within expected boundaries

No significant runtime deltas (all within run-to-run noise) and no internal-counter outliers.

Runtime details (per benchmark × JDK)
Benchmark JDK Latest Dev Δ (dev vs latest) Issues L/D
akka-uct 21 ✅ 10288 ms (21 iters) ✅ 10150 ms (21 iters) ≈ -1.3% (±11.5%) — / —
akka-uct 25 ✅ 8875 ms (24 iters) ✅ 8975 ms (24 iters) ≈ +1.1% (±10.6%) — / —
finagle-chirper 25 ✅ 5508 ms (36 iters) ✅ 5491 ms (36 iters) ≈ -0.3% (±24.3%) ⚠️ W:3 / ⚠️ W:3
fj-kmeans 21 ✅ 2661 ms (69 iters) ✅ 2713 ms (69 iters) ≈ +2% (±2.7%) — / —
fj-kmeans 25 ✅ 2865 ms (66 iters) ✅ 2841 ms (66 iters) ≈ -0.8% (±2.6%) — / —
future-genetic 21 ✅ 2107 ms (88 iters) ✅ 2126 ms (87 iters) ≈ +0.9% (±2.7%) — / —
future-genetic 25 ✅ 2068 ms (89 iters) ✅ 2110 ms (88 iters) ≈ +2% (±2.6%) — / —
naive-bayes 21 ✅ 1292 ms (132 iters) ✅ 1224 ms (139 iters) ≈ -5.3% (±31.9%) — / —
naive-bayes 25 ✅ 1012 ms (169 iters) ✅ 984 ms (173 iters) ≈ -2.8% (±31.3%) — / —
reactors 21 ✅ 16274 ms (15 iters) ✅ 17426 ms (15 iters) ≈ +7.1% (±7.6%) — / —
reactors 25 ✅ 18845 ms (15 iters) ✅ 18270 ms (15 iters) ≈ -3.1% (±3.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 ✅ / ✅ ✅ / ✅ 3 / 4 2097 / 1909 ✅ / ✅ ✅ / ✅
akka-uct 25 ✅ / ✅ ✅ / ✅ 3 / 1 2062 / 2338 ✅ / ✅ ✅ / ✅
finagle-chirper 21 ✅ / ✅ ✅ / ✅ 1 / 2 8704 / 8842 ✅ / ✅ ✅ / ✅
finagle-chirper 25 ✅ / ✅ ✅ / ✅ 3 / 2 8473 / 8584 ✅ / ✅ ✅ / ✅
fj-kmeans 21 ✅ / ✅ ✅ / ✅ 1 / 1 1246 / 1251 ✅ / ✅ ✅ / ✅
fj-kmeans 25 ✅ / ✅ ✅ / ✅ 1 / 2 1309 / 1292 ✅ / ✅ ✅ / ✅
future-genetic 21 ✅ / ✅ ✅ / ✅ 2 / 2 2935 / 2923 ✅ / ✅ ✅ / ✅
future-genetic 25 ✅ / ✅ ✅ / ✅ 2 / 1 2825 / 2908 ✅ / ✅ ✅ / ✅
naive-bayes 21 ✅ / ✅ ✅ / ✅ 5 / 4 3535 / 3528 ✅ / ✅ ✅ / ✅
naive-bayes 25 ✅ / ✅ ✅ / ✅ 4 / 6 3515 / 3473 ✅ / ✅ ✅ / ✅
reactors 21 ✅ / ✅ ✅ / ✅ 1 / 1 1706 / 1935 ✅ / ✅ ✅ / ✅
reactors 25 ✅ / ✅ ✅ / ✅ ✅ / ✅ 1880 / 1862 ✅ / ✅ ✅ / ✅

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