-
Notifications
You must be signed in to change notification settings - Fork 322
Prevent IllegalAccessError in OpenJDK 17.0.4 by excluding javax.management.* & javax.swing.* #4422
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
Prevent IllegalAccessError in OpenJDK 17.0.4 by excluding javax.management.* & javax.swing.* #4422
Conversation
| 2 javax.xml.* | ||
| # Prevent IllegalAccessError in OpenJDK 17.0.4 | ||
| 2 javax.management.* | ||
| 2 javax.swing.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these need to be 1 system level ignore for this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both 1 or 2 will work in production because we treat both as ignored.
The difference is when running tests - additional ignores (2) are not ignored during testing so we can detect when an instrumentation was applied during a unit test, but won't be applied in production. This helps us find ignores that are too wide and might unknowingly disable an existing instrumentation.
Typically though we mark JDK packages as 1 and application/library packages as 2 - so this should really be 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should also be moved up to the system section, to clarify these are JavaSE javax packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that some classes in the javax.management and javax.swing packages are matched by some instrumentations thus I added them to additional ignores to be able to catch if these are too wide to ignore. Also javax.el and javax.xml are put into additional ignores. Should we also move them to system level ignores then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javax.el.* and javax.xml.* were in the original AdditionalLibraryIgnoresMatcher class - they were probably put there because they cover JavaEE packages which typically exist in additional spec jars, not JavaSE (although since then JavaSE has included content under those packages)
I don't mind whether they get moved alongside the new JavaSE javax. ignores or if they're left where they are.
Regarding instrumentations matching classes under javax.management and javax.swing packages - that's likely because we try to cover threading for context-propagation. However, not every thread or runnable is of interest and the threads under javax.management and javax.swing are unlikely to have active traces needing propagation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for providing context about javax.el.* and javax.xml.*!
As far as instrumentations matching classes those mostly RunnableInstrumentation, RunnableFutureInstrumentation, and some of JavaExecutorInstrumentation, NonStandardExecutorInstrumentation, ClassloadingInstrumentation, but I agree that they are unlikely to have active traces needing propagation. So, I'll move them to system level ignores, as @bantonsson proposed.
3714b92 to
a55f4c8
Compare
…ement.* & javax.swing.*
a55f4c8 to
35bdabf
Compare
What Does This Do
Prevent
IllegalAccessErrorin OpenJDK 17.0.4 by excluding javax.management.* & javax.swing.*Motivation
Customer case APMS-8366
Additional Notes