-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
native-image optimisations to allow excluding the JDK's XML parser from a PostgreSQL / Hibernate app #17902
Conversation
Thanks for your pull request! The title of your pull request does not follow our editorial rules. Could you have a look?
|
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.
Looks great! I'm just not sure that the tests leveraging the XML feature are enough, see below.
(Also a comment about logs, but feel free to ignore it)
...postgresql/runtime/src/main/java/io/quarkus/jdbc/postgresql/runtime/graal/SQLXLMFeature.java
Show resolved
Hide resolved
...postgresql/runtime/src/main/java/io/quarkus/jdbc/postgresql/runtime/graal/SQLXLMFeature.java
Show resolved
Hide resolved
...tgresql-withxml/src/main/java/io/quarkus/it/jpa/postgresql/JPAFunctionalityTestEndpoint.java
Outdated
Show resolved
Hide resolved
* This is a general utility to assert via | ||
* unit testing which classes have been included in a native-image. | ||
*/ | ||
public final class ClassInclusionReport { |
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.
Having this might enable tracking noticeable class inclusion increases over different versions?
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.
yes exactly! Both caused by changes in our code and changes in GraalVM - it will be tested on each build, we just need to use this test helper more frequently, and make sensible choices such as for which types we consider the contract broken.
I've had another couple of challenges, but fixed now. Also opened: |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 01b0bcb
Full information is available in the Build summary check run. Test Failures⚙️ JVM Tests - JDK 11 #📦 integration-tests/jpa-postgresql-withxml✖ ⚙️ JVM Tests - JDK 16 #📦 integration-tests/jpa-postgresql-withxml✖ ⚙️ Native Tests - Data5 #📦 integration-tests/jpa-postgresql-withxml✖ |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 4c89272
Full information is available in the Build summary check run. Test Failures⚙️ Native Tests - Data5 #📦 integration-tests/jpa-postgresql-withxml✖ |
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.
Tests seem to be failing, unfortunately. I think I also spotted dead code.
...tgresql-withxml/src/main/java/io/quarkus/it/jpa/postgresql/JPAFunctionalityTestEndpoint.java
Outdated
Show resolved
Hide resolved
The native test failure is puzzling me, it looks like it wasn't run with the latest version I pushed. the logs specifically mention:
which is triggering this hot-fix:
Yet compilation fails with:
Yesterday I've been re-verifying this need by removing those lines and then re-introducing them a couple of times, it looks like the build triggered with one of the intentionally failing cases. The failing log mentions git ref |
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, let's see if tests pass... :)
Looks like the failure is triggered by the fact that the GraalVM version I'm using locally is slightly different, I'll investigate. |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building d9af480
Full information is available in the Build summary check run. Test Failures⚙️ Native Tests - Data5 #📦 integration-tests/jpa-postgresql-withxml✖ |
it's a problem with locales mismatching, making the resource bundle lookup fail. This works automagically on my local GraalVM build, but not yet on the tag we're using. |
…sing capabilities only when required
@yrodiere technically I feel this was probably a different issue :) but solved it by adding yet another substitution |
part of the problem is that the matching resourcebundles don't even exist for some of the languages we're triggering. So the inclusion rule would only include the ones found (and even then not all), but the ones missing at runtime would cause a critical crash as GraalVM would prefer to indicate that they have likely not been registered for inclusion, rather than treating them as really not existent. |
Failing Jobs - Building 962dc02
Full information is available in the Build summary check run. Test Failures⚙️ MicroProfile TCKs Tests #📦 tcks/microprofile-config✖ ✖ ✖ ✖ ✖ ✖ ✖ |
ok so |
This fixes a regression in RSS memory consumption in Quarkus "crud" based examples.
It turns out the AutomaticFeature of GraalVM which triggers inclusion of the XML parsers is triggered by the combination of having an Hibernate ORM's
PostgresUUIDType
and the postgresql JDBC driver.We include now an additional AutomaticFeature which helps the compiler to better identify this code path is unreacheable (when and only when it actually is). Comments in code provide more detail.