-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Add null check for G1 related options and origin field #93197
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 null check for G1 related options and origin field #93197
Conversation
|
💚 CLA has been signed |
|
We have a confirmation from Elastic's Legal Ops that the CLA is signed. |
a306df2 to
0a6bcbc
Compare
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
Hi @DmitryNekrasov, Thanks for proposing this PR. We don't support Azul Prime, but I think if a customer decided to use it themselves, I think Elasticsearch should run. My feedback on this particular PR is as follows:
Thanks again and please let me know if this makes sense or not. |
|
Hi @grcevski! Thank you for your comment. Azul Platform Prime JDK only supports its own collector - C4 Garbage Collector, it does not support other collectors, and, as a result, we do not have options for configuring them, which is why it is proposed to add a check for these options against null. PrintFlagsFinal message example for jdk8 in OpenJDK: PrintFlagsFinal message example for jdk11 in OpenJDK: And elastic is tied to the new message format from jdk11+. However, older versions of the Azul Platform Prime JDK have the same message format for all jdk versions, and it is the same as the jdk8 format from OpenJDK. This format does not have an |
0a6bcbc to
06c588d
Compare
|
Thanks for the explanation @DmitryNekrasov! I think adding the null checks makes sense. I think we should be good to go, except that I think we should add tests in This is exactly what caused the issue, and I want to make sure that future refactoring in the There are plenty of example tests in Perhaps also a test with manually created JvmOption which has a |
06c588d to
1defde8
Compare
Hi @grcevski! |
|
@elasticsearchmachine test this please |
grcevski
left a comment
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.
LGTM! The changes look great, thanks for all the iterations.
We need to make the CI green and it seem two things need to be done:
- Change area to
Infra/Settingsas per my comment in the YAML file. - You'll need to rebase on main again, we had updated out backwards compatibility tests since this was branched and those tests fail. Simply merge the main branch and push the updated.
558a8e0 to
deda1ed
Compare
|
@elasticsearchmachine test this please |
This patch fixes some issues when starting Elasticsearch on the Azul Platform Prime JDK. The first of them is related to the fact that the Azul Platform Prime JDK does not have a G1 garbage collector, and, as a result, there are no options for configuring it. One fix checks that these options exist and are not null. The second fix is related to the following. When parsing the message output, which is obtained using the -XX:+PrintFlagsFinal option, we are tied to the fact that there is an origin field in the PrintFlagsFinal message string. This is valid for jdk11+ versions, however jdk8 does not have this field. Older versions of the Azul Platform Prime JDK use the PrintFlagsFinal message format that jdk8 uses, but for later versions. The second fix adds a null check for the origin field in the JvmOption class. Relates elastic#91577.
deda1ed to
8a5cb60
Compare
thecoop
left a comment
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.
Oh, yes, my comment was just a minor nit
|
@dimitrynekrasov Thanks very much for your interest in Elasticsearch. We choose to support particular JDKs with care. We test the JDKs on our CI with our full suite of tests, we create JDK specific options tests, and our team ensures that every Elasticsearch release works correctly with those JDKs. Additionally we need to spend time investigating failures on those JDKs, and making sure performance is acceptable, etc. Because of the above we generally will not merge PRs targeting an untested and unsupported JDK because we cannot guarantee that the change works, and will continue to work in future releases and we aren't prepared to have code in the repository that we cannot maintain, because it's not tested. It would be a very bad experience for our users if Elasticsearch suddenly stopped working on a particular JDK after an upgrade. This change has the stated goal of allowing Elasticsearch to run on the Azul Prime JDK. While it does not add any Azul specific logic, it does add leniency in our CLI where none was previously needed. That leniency could lead to masking an actual problem in our parsing logic on our officially supported JDKs. Given the reasoning above, I will close this PR. However, we do understand the desire to have the flexibility to still make your setup work, regardless of our inability to officially support it. Your PR intended to address two issues. The first is regarding the G1GC settings. These have now been guarded so that Elasticsearch will ignore if G1 options are not present (or if G1 has been disabled through In general, making the Azul Prime JDK more compatible with OpenJDK is more likely to result in Elasticsearch working on it. While we don't intend to support that JDK, we do hope you consider this suggestion. These issues in the CLI are unlikely to be the last given our tight coupling with OpenJDK behavior and internals. |
|
@rjernst Thank you for the commentary. Obviously, we're not super happy about the decision as we would really love to be officially supported JDK, but I also understand your reasoning. We'll try to persuade you with some astonishing performance data in the future to change your decision :) In the meantime, we have actually implemented the fix on Prime's side, so Elasticsearch will work seamlessly on the newest Prime version (starting since 22.12 I believe). One more question - what happens if your customer wants to run on Prime (there are already some)? We're obviously happy to support them on our side with the JVM issues but I'm wondering how will your support policy react if the customer is running on Prime and e.g. the issue is obviously unrelated to JDK. Would it be a big no-no "hey, you're running on unsupported JDK, we're closing the ticket", or "hey, after looking at this issue, we're suspecting a problem with JDK compatibility. Please go to your Azul support?". The latter would be absolutely fine. Thanks a lot for your comments. |
|
It would be the latter. We might first ask the user to try to reproduce the issue on a supported JDK (for example, running the same reproduction steps but with the bundled jdk), but if we can reproduce with OpenJDK, we would keep the issue open and see how best to address it. |
|
@rjernst Makes perfect sense. Thank you. |
This patch fixes some issues when starting Elasticsearch on the Azul Platform Prime JDK.
The first of them is related to the fact that the Azul Platform Prime JDK does not have a G1 garbage collector, and, as a result, there are no options for configuring it. One fix checks that these options exist and are not null.
The second fix is related to the following. When parsing the message output, which is obtained using the
-XX:+PrintFlagsFinaloption, we are tied to the fact that there is anoriginfield in the PrintFlagsFinal message string. This is valid for jdk11+ versions, however jdk8 does not have this field. Older versions of the Azul Platform Prime JDK use the PrintFlagsFinal message format that jdk8 uses, but for later versions. The second fix adds a null check for theoriginfield in the JvmOption class.Relates #91577.