Skip to content

Prevent continuation leaks in Pekko fork-join tasks - #13765

Open
ygree wants to merge 2 commits into
masterfrom
ygree/pekko-fork-join-continuation-fix
Open

ygree wants to merge 2 commits into
masterfrom
ygree/pekko-fork-join-continuation-fix

Conversation

@ygree

@ygree ygree commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Preserves parent trace context for Pekko fork-join tasks and lets traces publish after tasks finish, are rejected, or are cancelled.

Motivation

PekkoForkJoinTask invokes its wrapped runnable from exec(). The previous Pekko advice captured a continuation in the constructor and expected to resume it in run(). A Java 17 probe showed that a lambda inherited the correct parent through the JDK hooks while the extra Pekko continuation stayed open after the task finished.

Additional Notes

Ref: #13657

  • The generic JDK fork-join hooks handle propagation when enabled. The Pekko fallback captures context at submission, resumes it in exec(), and releases it on rejection or cancellation.
  • Pekko mailboxes already extend the JDK's ForkJoinTask, so the pool submits them directly.
  • The new regression tests cover parent propagation, rejection, and queued cancellation with the generic hooks enabled and disabled.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@ygree ygree self-assigned this Dec 2, 2026
@ygree ygree added type: bug fix Bug fix inst: others All other instrumentations tag: ai generated Largely based on code generated by an AI or LLM labels Dec 2, 2026
@datadog-prod-us1-4

Copy link
Copy Markdown

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.82% (+7.15%)

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

@dd-octo-sts

dd-octo-sts Bot commented Dec 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.10 s 14.03 s [-0.2%; +1.2%] (no difference)
startup:insecure-bank:tracing:Agent 13.07 s 13.03 s [-0.6%; +1.1%] (no difference)
startup:petclinic:appsec:Agent 17.07 s 17.58 s [-7.2%; +1.4%] (no difference)
startup:petclinic:iast:Agent 17.64 s 17.67 s [-0.9%; +0.6%] (no difference)
startup:petclinic:profiling:Agent 17.38 s 17.41 s [-1.2%; +0.9%] (no difference)
startup:petclinic:sca:Agent 17.78 s 17.66 s [-0.2%; +1.6%] (no difference)
startup:petclinic:tracing:Agent 16.74 s 17.00 s [-2.4%; -0.6%] (maybe better)

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

@ygree
ygree marked this pull request as ready for review December 2, 2026 02:41
@ygree
ygree requested review from a team as code owners December 2, 2026 02:41
@ygree
ygree requested review from ValentinZakharov and jandro996 and removed request for a team December 2, 2026 02:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T02:46:30.900556Z b64ed4f Draft marked ready
🔒 Security Review ✅ Completed 2026-12-02T02:47:03.662743Z b64ed4f 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.

Bits Code Review: PASS

More details

The Pekko fallback resumes captured context in exec(), where the wrapped runnable executes, and releases it on rejection or cancellation. The completed static review identified no reportable defect; runtime behavior was not exercised.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit b64ed4f

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

inst: others All other instrumentations tag: ai generated Largely based on code generated by an AI or LLM type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant