Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK 24 support for Executors and StructuredTaskScope #13299

Open
bdeneuter opened this issue Feb 14, 2025 · 3 comments
Open

JDK 24 support for Executors and StructuredTaskScope #13299

bdeneuter opened this issue Feb 14, 2025 · 3 comments
Labels
bug Something isn't working needs triage New issue that requires triage

Comments

@bdeneuter
Copy link

Describe the bug

We are testing our code against JDK 24 EA which will be released next month.
We have 2 tests which test the javaagent instrumentation and which pass on JDK 23 but fail on JDK 24 EA:

  • one test checks the instrumentation from Executors.newVirtualThreadPerTaskExecutor
  • one test checks the instrumentation from StructuredTaskScope and structured concurrency

Steps to reproduce

Run a test on JDK 24 with the OTEL Java agent:

  • create a trace and span
  • start a Executors.newVirtualThreadPerTaskExecutor()
  • submit a Runnable on the Executor which test that the trace is the same

Same test for StructuredTaskScope

Expected behavior

We expect in the test that the trace is continued in the subtask or in the Runnable/Callable which is submitted to the Executor and StructuredTaskScope

Actual behavior

Fails with a NullPointerException because there is no trace available in the subtask

Javaagent or library instrumentation version

2.12.0

Environment

JDK: 24.ea.36-open
OS: OS X

Additional context

No response

@bdeneuter bdeneuter added bug Something isn't working needs triage New issue that requires triage labels Feb 14, 2025
@trask
Copy link
Member

trask commented Feb 28, 2025

cc @JonasKunz in case you have time to look at this

not sure if it's related to the failures we're seeing with our existing tests on JDK 24: #13376

@JonasKunz
Copy link
Contributor

I'll try to have a look. Apparently in #13376 our own tests pass now for both StructuredTaskScope and Executors.newVirtualThreadPerTaskExecutor(). Atleast it looks to me like they are not disabled there.

@bdeneuter could you provide an example repository reproducing the issue? Our tests doing exactly what you described seem to pass on JDK 24.

@bdeneuter
Copy link
Author

@JonasKunz I created a repo with a test which fails on my macbook pro when I set the Java toolchain to JDK 24:
https://github.com/bdeneuter/jdk24-otel

If I put it on the JDK 23 then the test pass:
https://github.com/bdeneuter/jdk24-otel/blob/main/build.gradle#L9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

3 participants