-
Notifications
You must be signed in to change notification settings - Fork 282
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
Add suppression for all removal warnings #1828
Conversation
Use of the SecurityManager and AccessController have been deprecated and will be removed in java versions after 17. While this is an issue its also one that will take a concerted effort to resolve. These warning messages making discovering build errors and other warnings more difficult; hence adding this supression logic. For tracking the effort to replace these components look into opensearch-project/OpenSearch#1687 Signed-off-by: Peter Nied <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1828 +/- ##
============================================
- Coverage 60.81% 60.80% -0.01%
+ Complexity 3187 3185 -2
============================================
Files 253 253
Lines 17931 17943 +12
Branches 3204 3205 +1
============================================
+ Hits 10904 10910 +6
- Misses 5450 5454 +4
- Partials 1577 1579 +2
Continue to review full report at Codecov.
|
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.
A couple of questions here:
- Why removing warning message instead of disabling Java Security Manager?
- Quoted from the issue:
We could keep it as long as we can, but once removed from the JDK, it will be a problem.
If disabling JSM, what will be the problem?
Thanks for the question @cliu123
We cannot disable the java security manager without exposing a risk that our or other plugins will do something they are not privileged to do. For example, another plugin could reflect on static configuration settings and then change the admin cert to whatever they would like (yikes!) by using the security manager there is a production build into running plugins within our JVM instance. These messages are not useful making it hard to troubleshoot build errors, as these errors are embedded in the design of OpenSearch. Deprecation messages are useful if we were adding a component that we did not realize was deprecated and wanted to gate that dependency. You raise a good point, I'll push a change in the setting of our build to treat warnings as errors. |
Signed-off-by: Peter Nied <[email protected]>
Exactly, JSM being deprecated should be warned in this case, shouldn't it? OpenSearch core doesn't suppress these warns either. |
@cliu123 This pull request doesn't eliminate deprecation messages, it suppresses them on components that we have no plans to fix. It is confusing for contributors or even maintainers such as myself to see 'warnings' in our build output that we should actively ignore, which is why I am suppressing warnings on these components. If a new warning was to be added in a pull request we would have no mechanism to detect it. By suppressing these messages and failing builds on any new messages this puts the codebase in a better posture to prevent new dependencies on deprecated/removed features. Is there a reason to keep the existing warnings as they are today? |
Thanks for the clarification!
I have a couple of questions here:
|
@cliu123 a few clarifications:
Yes, for JDK-17 and above you will get these warnings at runtime :( (even trickier for JDK-18+)
We have this large story [1] to clarify the path forward. OpenSearch heavily relies on |
I see. Thanks for the clarification! @peternied @reta |
Signed-off-by: Peter Nied <[email protected]> Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Description
Use of the SecurityManager and AccessController have been deprecated and
will be removed in java versions after 17. While this is an issue its
also one that will take a concerted effort to resolve. These warning
messages making discovering build errors and other warnings more
difficult; hence adding this supression logic.
For tracking the effort to replace these components look into opensearch-project/OpenSearch#1687
Issues Resolved
Check List
New functionality includes testingNew functionality has been documentedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.