Skip to content

[Bug] api-jdk-forkjoinpool-plugin not effective in jdk11 #11633

@786991884

Description

@786991884

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

Java Agent (apache/skywalking-java)

What happened

I found that in this java file (https://github.com/apache/skywalking-java/blob/v9.0.0/apm-sniffer/bootstrap-plugins/jdk-forkjoinpool-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/forkjoinpool/define/ForkJoinWorkerQueueInstrumentation.java)
this variable of method is not in jdk11,it is in jdk8
private static final String FORK_JOIN_WORKER_QUEUE_RUN_TASK_METHOD = "runTask";

What you expected to happen

in java11
The runWorker method is one of the core methods of ForkJoinPool, responsible for retrieving tasks from the work queue and executing them.

Within the runWorker method, it calls the scan method to search and execute tasks.

ForkJoinPool. scan calls WorkQueue. topLevelExec

/** * Runs the given (stolen) task if nonnull, as well as * remaining local tasks and others available from the given * queue, up to bound n (to avoid infinite unfairness). */ final void topLevelExec(ForkJoinTask<?> t, WorkQueue q, int n) { if (t != null && q != null) { // hoist checks int nstolen = 1; for (;;) { t.doExec(); if (n-- < 0) break; else if ((t = nextLocalTask()) == null) { if ((t = q.poll()) == null) break; else ++nstolen; } } ForkJoinWorkerThread thread = owner; nsteals += nstolen; source = 0; if (thread != null) thread.afterTopLevelExec(); } }

How to reproduce

in java8 api-jdk-forkjoinpool-plugin is effective.
in java11 api-jdk-forkjoinpool-plugin is not effective.

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

Labels

agentLanguage agent related.bugSomething isn't working and you are sure it's a bug!good first issueGood first issue for beginnersjavaJava agent relatedpluginPlugin for agent or collector. Be used to extend the capabilities of default implementor.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions