-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix Javascript tiered broker selector strategy and Javascript filter for Java 17 #14795
base: master
Are you sure you want to change the base?
Conversation
7c53d31
to
9ad5a79
Compare
This pull request has been marked as stale due to 60 days of inactivity. |
This pull request/issue has been closed due to lack of activity. If you think that |
Reopening this PR as Java 8 was dropped. We have been using this patch running on Java 17 for the last year and found no issue. |
@maytasm I'm curious that what kind of javascript code you're using for the select strategy? |
@FrankChen021 Looking at query interval and certain key in the query context |
I believe this should be merged and included in Druid 32.0.0 release #17677 since javascript strategies won't work on recommended JDK version, this might be braking change for some people! |
@adarshsanjeev Lets mention this in the upgrade notes . We are too far along the process to do another RC now. Lets include it in druid 33. |
Actually, I think we can't use org.openjdk.nashor since it is under GNU General Public License v2.0 ? |
I believe that assessment is correct, Maytas via gen AI prompt:
|
Fix Javascript tiered broker selector strategy and Javascript filter for Java 17
Description
Javascript tiered broker selector strategy and Javascript filter broke when running Druid on Java 17.
Javascript tiered broker selector strategy and Javascript filter depend on Nashorn JavaScript Engine (
final ScriptEngine engine = new ScriptEngineManager().getEngineByName("javascript");
). The Nashorn JavaScript Engine has been removed from Java. Deprecated in Java 11, removed in Java 15. (https://stackoverflow.com/questions/71481562/use-javascript-scripting-engine-in-java-17)Some options I found:
I chose the second option which is to add back the Nashorn JavaScript Engine as a dependency and continue to use it. Since Nashorn was the deprecated javascript engine that used to come with Java 8, I think it should be same/similar to what we had before (compare to using a new script engine like GraalVM). However, https://github.com/szegedi/nashorn/wiki/Using-Nashorn-with-different-Java-versions suggests that the standalone is not compatible with Java 8-10 and is only compatible with Java 11 and later
This PR has: