Repository navigation
Avoid capturing request context in OpenJDK 25 virtual-thread timeout tasks - #12851
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
The exclusion targets JDK virtual-thread callbacks while preserving context capture for application-scheduled Runnable and Callable tasks. The completed static review found no actionable correctness issue; runtime behavior remains unverified.
🤖 Bits Code Review · Commit 080ffc2
This comment has been minimized.
This comment has been minimized.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
PerfectSlayer
left a comment
There was a problem hiding this comment.
The exclusion uses the generated java.lang.VirtualThread$$Lambda/ class-name prefix. This depends on JDK implementation details and covers all lambdas owned by VirtualThread, so it should be revisited if their responsibilities or naming change.
That might bite us later… No other way than relying on JDK-specific and all lambdas?
dougqh
left a comment
There was a problem hiding this comment.
Overall, this looks good to me.
Claude had a couple suggestions that I think would be good to address.
I also think it would make more sense to label that as bug:fix or performance rather than feature.
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Build pipeline has failing jobs for 902289e: What to do next?
DetailsSince those jobs are not marked as being allowed to fail, the pipeline will most likely fail. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
OpenJDK 25 schedules virtual-thread timeout callbacks through
ForkJoinPool. Our scheduled-task instrumentation captures the creating request context for these callbacks, even though they only wake the virtual thread and do not consume that context.This PR excludes JDK-owned
VirtualThreadlambdas from context capture. This avoids unnecessary continuation allocation and request-context retention while preserving propagation for application-scheduled tasks.Validation includes a diagnostic test checking capture absence while a virtual thread is parked, FJP scheduling tests checking application context propagation, and packaged-agent cold-start smoke tests checking parking and resumption with virtual-thread instrumentation both enabled and disabled. The FJP instrumentation independently preloads its context-filtering helper.
The exclusion uses the generated
java.lang.VirtualThread$$Lambda/class-name prefix and covers all lambdas owned byVirtualThread. It depends on JDK implementation details. Validation was performed on HotSpot/OpenJDK 25 with the default virtual-thread scheduler. The OpenJ9 lambda metafactory source uses the same naming mechanism, but OpenJ9 runtime compatibility has not been tested. Revisit the exclusion if lambda naming or responsibilities change. Custom virtual-thread schedulers are outside the demonstrated coverage.Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]