Skip to content

Interrupted thread callsite resolution#2752

Merged
SylvainJuge merged 5 commits intoelastic:mainfrom
SylvainJuge:indy-interrupted-thread
Aug 31, 2022
Merged

Interrupted thread callsite resolution#2752
SylvainJuge merged 5 commits intoelastic:mainfrom
SylvainJuge:indy-interrupted-thread

Conversation

@SylvainJuge
Copy link
Member

@SylvainJuge SylvainJuge commented Aug 23, 2022

What does this PR do?

When an application thread was interrupted and the interrupted status hasn't been cleared, it makes the instrumentation call site resolution fail with ClosedByInterruptException, hence making the instrumentation fail and resolve to a no-op.

When this happens, a stack trace similar to the following is visible in the agent logs;

(...) ERROR co.elastic.apm.agent.bci.IndyBootstrap - null
java.nio.channels.ClosedByInterruptException: null
        at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:199) ~[?:?]
        at sun.nio.ch.FileChannelImpl.endBlocking(FileChannelImpl.java:162) ~[?:?]
        at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:388) ~[?:?]
        at jdk.nio.zipfs.ZipFileSystem.findEND(ZipFileSystem.java:973) ~[jdk.zipfs:?]
        at jdk.nio.zipfs.ZipFileSystem.initCEN(ZipFileSystem.java:1048) ~[jdk.zipfs:?]
        at jdk.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:116) ~[jdk.zipfs:?]
        at jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:106) ~[jdk.zipfs:?]
        at java.nio.file.FileSystems.newFileSystem(FileSystems.java:337) ~[?:?]
        at java.nio.file.FileSystems.newFileSystem(FileSystems.java:286) ~[?:?]
        at co.elastic.apm.agent.util.PackageScanner.getClassNames(PackageScanner.java:61) ~[elastic-apm-agent.jar:1.33.0]
        at co.elastic.apm.agent.bci.IndyBootstrap.getClassNamesFromBundledPlugin(IndyBootstrap.java:440) ~[elastic-apm-agent.jar:1.33.0]
        at co.elastic.apm.agent.bci.IndyBootstrap.bootstrap(IndyBootstrap.java:399) [elastic-apm-agent.jar:1.33.0]
        at jdk.internal.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at java.lang.IndyBootstrapDispatcher.bootstrap(IndyBootstrapDispatcher.java:60) [?:?]
        at java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:138) [?:?]
        at java.lang.invoke.CallSite.makeSite(CallSite.java:307) [?:?]
        at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:258) [?:?]
        at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:248) [?:?]

A similar instance of this issue has already been reported in the forum here.

Checklist

  • This is a bugfix
@ghost
Copy link

ghost commented Aug 23, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-31T11:40:19.724+0000

  • Duration: 59 min 41 sec

Test stats 🧪

Test Results
Failed 0
Passed 3132
Skipped 36
Total 3168

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark tests.

  • run jdk compatibility tests : Run the JDK Compatibility tests.

  • run integration tests : Run the Agent Integration tests.

  • run end-to-end tests : Run the APM-ITs.

  • run windows tests : Build & tests on windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SylvainJuge SylvainJuge marked this pull request as ready for review August 23, 2022 09:39
@github-actions
Copy link

/test

@SylvainJuge SylvainJuge enabled auto-merge (squash) August 31, 2022 11:40
@SylvainJuge SylvainJuge merged commit e390674 into elastic:main Aug 31, 2022
@SylvainJuge SylvainJuge deleted the indy-interrupted-thread branch August 31, 2022 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants