Skip to content
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

[Java 21 runtime] Java 21 runtime support for WSO2 Identity Server #21158

Closed
indeewari opened this issue Sep 25, 2024 · 9 comments
Closed

[Java 21 runtime] Java 21 runtime support for WSO2 Identity Server #21158

indeewari opened this issue Sep 25, 2024 · 9 comments
Assignees
Milestone

Comments

@indeewari
Copy link
Contributor

indeewari commented Sep 25, 2024

Describe the issue:
The latest LTS release of Java; Java 21 was released on September 2023. As Identity Server is a downloadable product which will be used years after its releases, its important to plan for the latest LTS support for a upcoming release proactively.

This initiative aims to ensure compatibility with the Java 21 runtime for the IS product.

  1. Remove sun.java dependencies to ensure compatibility with the Java 21 LTS .
  2. Resolving Strong Encapsulation Errors.
  3. Product IS builder github actions for 17 and 21.
  4. Test failures with Nashorn.
  5. Update the Docker images on Java 21 runtime.
  6. Update the official IS documentation for Java 21 runtime support.
  7. Update the error message on startup
  8. Performance evaluation against JDK 11 runtime
@indeewari
Copy link
Contributor Author

indeewari commented Sep 25, 2024

  1. Remove sun.java dependencies to ensure compatibility with the Java 21 LTS runtime.

With the introduction of Java 21 LTS, most of the sun.java classes and methods are no longer supported. These internal APIs were never intended for public use and have been strongly encapsulated since Java 9. Continuing to rely on them in Java 21 poses significant risks, including potential runtime failures and compatibility issues. Therefore, it's essential to refactor the codebase to replace sun.java dependencies with standard, supported Java APIs to ensure long-term stability and maintainability of the product.

Related PRs

@indeewari indeewari moved this to In Progress in Identity Server 7.1.0 Sep 25, 2024
@indeewari indeewari self-assigned this Sep 26, 2024
@indeewari
Copy link
Contributor Author

indeewari commented Sep 26, 2024

  1. Resolving Strong Encapsulation Errors in JDK Internals

Some non-critical JDK internals, which are strongly encapsulated, are accessed via reflection for audit purposes. There are two approaches to address this:

  1. Eliminate the use of strongly encapsulated JDK internals accessed through reflection.
  2. Opt for relaxed strong encapsulation.

The choice between these options should be made on a case-by-case basis.

After evaluating backward compatibility, impact areas, and implementation complexity, we have opted for relaxed strong encapsulation for the following modules:

For java.base:

  • sun.security.util
  • java.security
  • sun.security.rsa
  • java.security.cert

Related PRs

@indeewari
Copy link
Contributor Author

indeewari commented Oct 4, 2024

@indeewari
Copy link
Contributor Author

indeewari commented Oct 4, 2024

@indeewari
Copy link
Contributor Author

indeewari commented Oct 21, 2024

@indeewari
Copy link
Contributor Author

indeewari commented Oct 21, 2024

  1. Update the official IS documentation for Java 21 runtime support.
    Email "[Architecture] Review of JDK Compatibility Matrix for WSO2 Identity Server"

@indeewari
Copy link
Contributor Author

indeewari commented Oct 25, 2024

This task is in the state of completed.
Waiting for wso2/docs-is#4824 pr to be merged to close the issue.

Email reference "Review of JDK Compatibility Matrix for WSO2 Identity Server"

@nilasini nilasini modified the milestones: 7.1.0-m4, 7.1.0-m5 Oct 28, 2024
@indeewari
Copy link
Contributor Author

  1. Update the error message on startup

@indeewari
Copy link
Contributor Author

indeewari commented Nov 18, 2024

  1. Performance evaluation against JDK 11 runtime

The runtime performance of JDK 21 has been assessed in comparison to JDK 11 for WSO2 IS 7.1.m3.

For a lower heap size of 2 GB, JDK 21 exhibited decreased performance in a two-node performance setup, while showing improved performance with three and four nodes.
At a 4 GB heap size, JDK 21 demonstrated superior performance across all tested configurations (two, three, and four nodes).

Therefore, JDK 21 overall delivered better runtime performance than JDK 11 for WSO2 IS 7.1.m3.

Reference -
https://docs.google.com/spreadsheets/d/1_ET3BQS6HZ2vxQofdX6L6iJMsDbLDrV6_60gTgO-rXQ/edit?usp=sharing

@indeewari indeewari moved this from In Progress to Done in Identity Server 7.1.0 Nov 18, 2024
@indeewari indeewari closed this as completed by moving to Done in Identity Server 7.1.0 Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants