SOLR-17641: Disable the Security Manager for Java 24+#3153
SOLR-17641: Disable the Security Manager for Java 24+#3153janhoy merged 8 commits intoapache:mainfrom
Conversation
uschindler
left a comment
There was a problem hiding this comment.
I haven't tested the Windows code, but looks fine in general.
I will update Policeman Jenkins to latest Java 24 tomorrow. We may need changes in Lucene, too.
|
It's great that you made the disabling conditional on Java 24+. I wonder though if we are better served just removing it completely from Solr 10, regardless of version of Java? |
malliaridis
left a comment
There was a problem hiding this comment.
I've tested the Windows script schanges, works fine.
Can't build the project though with JDK 24 (ea).
Co-authored-by: Christos Malliaridis <[email protected]>
|
Agree with @epugh - isn't Security Manager all no-ops even with 21 (which IIRC is the minimum Java for Solr 10) |
I've never heard that. Do you have a link for that? |
No, it isn't. It's fully working in 21. It gets a noop in 24 (actually Access controller). In addition, you can't configure it anymore. |
| Java removed support for the Security Manager starting with Java 24, therefore Solr will disable the feature when run with Java 24 or later. | ||
|
|
There was a problem hiding this comment.
minor: Okay but arguably you didn't have to bother to say this. There's no action for the user to take. I don't think it's up to Solr to tell people what's coming/going/happening in the Java ecosystem.
There was a problem hiding this comment.
Copilot is of another opinion, see comment #3153 (comment)
|
#3284 already updated the tests, so this will mainly be for the startup scripts |
Sorry, I thought this PR was solved since long time... If you would like to remove the conflict, go ahead! This PR still contains some additional code and should be removed. The 2line fix by Chris is much easier than the complex logic added here. |
|
No worries at all. This had stalled because of concerns around security without the security manager. But since it's gone in newer JDK versions, that really doesn't matter for this ticket. Will update to remove the gradle changes. |
When will gradle 8.10.2 be updated (2024-09-23)? JDK 24 requires gradle 8.14: |
janhoy
left a comment
There was a problem hiding this comment.
This just needs to be done.
Only comment I have is whether the start script or solr itself should log a WARN log about security mgr being disabled, and hint that Java21 may be an option for better security, until we put in place more protection in other ways?
|
I wonder if we really need to put in warnings? If I am on Java 24, then I'll never go back to 21. And 21 won't be an option in a period of time. And if I care about security and have the ability to make a decision like use Java 21, then I already know that there is no security manager post 21.. I think putting in an open ended warning means that we'll be warning about something that there is not fix for. Java21 isn't a fix. And just makes us look weak/bad. Yeah, Solr on modern Java doesn't have a security manager. So does "Tika on modern Java". So does "Name your other big tool on monder Java". |
|
I opened up #3406 as an alternative approach for |
|
Fixed merge conflict in this. I'm ok with merging this as is. I tested running solr in Java 24, and without this fix (or explicitly disableing JSM) the start script will just spin and timeout, while the log prints So this simple PR is a great Java24 compat fix, giving users a choice betwen JRE21 with JSM or JRE24 without. |
epugh
left a comment
There was a problem hiding this comment.
Thanks for getting this to done!!
|
This PR has had no activity for 60 days and is now labeled as stale. Any new activity will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the [email protected] mailing list. To exempt this PR from being marked as stale, make it a draft PR or add the label "exempt-stale". If left unattended, this PR will be closed after another 60 days of inactivity. Thank you for your contribution! |
|
Despite encouraging comments discussions haven't been resolved, Gradle is still far too old to even build with JDK 24, and JDK 25 LTS will be released in 2 weeks... I have no hopes that this 7 months old contribution will be merged by then 😞 But probably no wonder with 272 open contributions and no free AI review helper like CodeRabbit enabled to shorten the feedback loop. |
|
I moved the change note to 9.10 section. @HoustonPutman do you want to land and backport this to 9x? |
|
https://github.com/apache/solr/actions/runs/17370856332/job/49306132986?pr=3153 |
|
@reneleonhardt The |
# Conflicts: # solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc
|
I volunteer to merge this once tests passes. |
There was a problem hiding this comment.
Pull Request Overview
This PR addresses Java 24+ compatibility by disabling the Security Manager feature, which was removed from Java 24. The change updates the Solr 9 upgrade documentation to inform users about this behavior change.
- Updates documentation to explain Security Manager handling for Java 24+
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc
Show resolved
Hide resolved
solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc
Show resolved
Hide resolved
Yes it is too old for JDK 24 but nonetheless it is only one year old, which isn't bad IMO. Someone will surely update it again before long.
There's GitHub CoPilot, and I intentionally activated its review in response to your remark. I'm not certain if contributors can self activate the review. BTW that 272 number is large but it probably filled with automated dependency upgrades that we're working through. |
|
Thank you for replying, contributors can't request CoPilot reviews if not enabled, for example the official documentation doesn't work here, you would have to check your personal, organization and repository settings. https://docs.github.com/en/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review Asking the documentation: To enable GitHub Copilot reviews in open-source repositories, follow these steps:
CodeRabbit is so much better: |
…pache#3153) Co-authored-by: Jan Høydahl <[email protected]> (cherry picked from commit 390e11d)
|
P.S.: You don't need a new Gradle for testing/building with Java 24. Gradle should always run on the "base version" (ideally 21). To run tests with Java 24 or Java 25, just use |
https://issues.apache.org/jira/browse/SOLR-17641