quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

[Narayana] Make all Record class and BeanPopulator to init at runtime

Open zhfeng opened this issue 9 months ago • 15 comments

revert https://github.com/quarkusio/quarkus/pull/40250

cc @mmusgrov

zhfeng avatar Apr 26 '24 13:04 zhfeng

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

quarkus-bot[bot] avatar Apr 26 '24 13:04 quarkus-bot[bot]

@gastaldi it needs to backport to 3.8

zhfeng avatar Apr 26 '24 13:04 zhfeng

The hibernate-orm-panache is failing in native build and I will investigate.

zhfeng avatar Apr 26 '24 16:04 zhfeng


:waning_crescent_moon: This workflow status is outdated as a new workflow run has been triggered.


Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 27b80df090def1e9f2804dd5d3fc1b7f2541c523.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
Native Tests - Data3 Build Failures Logs Raw logs :mag:
Native Tests - Data5 Build Failures Logs Raw logs :mag:
Native Tests - Main Build Failures Logs Raw logs :mag:

Full information is available in the Build summary check run. You can consult the Develocity build scans.

Failures

:gear: Native Tests - Data3 #

- Failing: integration-tests/hibernate-orm-panache 

:package: integration-tests/hibernate-orm-panache

Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:build (default) on project quarkus-integration-test-hibernate-orm-panache: Failed to build quarkus application


:gear: Native Tests - Data5 #

- Failing: integration-tests/jpa-postgresql integration-tests/jpa-postgresql-withxml 

:package: integration-tests/jpa-postgresql

io.quarkus.it.jpa.postgresql.ImageMetricsITCase.verifyImageMetrics line 16 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	org.opentest4j.AssertionFailedError: Expected analysis_results.methods.reflection to be within range [4708 +- 3%] but was 5004 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [201 +- 3%] but was 338 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)
	at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.verifyImageMetrics(NativeBuildOutputExtension.java:59)

:package: integration-tests/jpa-postgresql-withxml

io.quarkus.it.jpa.postgresql.ImageMetricsITCase.verifyImageMetrics line 15 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (3 failures)
	org.opentest4j.AssertionFailedError: Expected analysis_results.methods.reflection to be within range [4893 +- 3%] but was 5186 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected image_details.total_bytes to be within range [91650760 +- 3%] but was 94518080 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [170 +- 3%] but was 307 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)

:gear: Native Tests - Main #

- Failing: integration-tests/main 

:package: integration-tests/main

io.quarkus.it.main.ImageMetricsITCase.verifyImageMetrics line 15 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	org.opentest4j.AssertionFailedError: Expected analysis_results.methods.reflection to be within range [7741 +- 3%] but was 8253 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [496 +- 3%] but was 633 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)
	at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.verifyImageMetrics(NativeBuildOutputExtension.java:59)

quarkus-bot[bot] avatar Apr 26 '24 16:04 quarkus-bot[bot]

@mmusgrov these three classes CAN NOT be added to initlize at runtime currently.

       runtimeInit.produce(new RuntimeInitializedClassBuildItem(UserTransactionImple.class.getName()));
       runtimeInit.produce(new RuntimeInitializedClassBuildItem(TransactionManagerImple.class.getName()));
       runtimeInit.produce(new RuntimeInitializedClassBuildItem(BaseTransaction.class.getName()));

It looks like hibernate-orm-panache has something to use TransactionManager at build time. I don't have much time to do further investigation right now. So maybe we can open a followup issue?

zhfeng avatar Apr 26 '24 23:04 zhfeng


:waning_crescent_moon: This workflow status is outdated as a new workflow run has been triggered.


Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 4b14a90b3b8f61f848fd8dce3b3e214172e3406d.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
Native Tests - Data5 Build Failures Logs Raw logs :mag:
Native Tests - Main Build Failures Logs Raw logs :mag:

Full information is available in the Build summary check run. You can consult the Develocity build scans.

Failures

:gear: Native Tests - Data5 #

- Failing: integration-tests/jpa-postgresql integration-tests/jpa-postgresql-withxml 

:package: integration-tests/jpa-postgresql

io.quarkus.it.jpa.postgresql.ImageMetricsITCase.verifyImageMetrics line 16 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	org.opentest4j.AssertionFailedError: Expected analysis_results.methods.reflection to be within range [4708 +- 3%] but was 5004 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [201 +- 3%] but was 338 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)
	at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.verifyImageMetrics(NativeBuildOutputExtension.java:59)

:package: integration-tests/jpa-postgresql-withxml

io.quarkus.it.jpa.postgresql.ImageMetricsITCase.verifyImageMetrics line 15 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (3 failures)
	org.opentest4j.AssertionFailedError: Expected analysis_results.methods.reflection to be within range [4893 +- 3%] but was 5186 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected image_details.total_bytes to be within range [91650760 +- 3%] but was 94501696 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [170 +- 3%] but was 307 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)

:gear: Native Tests - Main #

- Failing: integration-tests/main 

:package: integration-tests/main

io.quarkus.it.main.ImageMetricsITCase.verifyImageMetrics line 15 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	org.opentest4j.AssertionFailedError: Expected analysis_results.methods.reflection to be within range [7741 +- 3%] but was 8253 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [496 +- 3%] but was 633 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)
	at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.verifyImageMetrics(NativeBuildOutputExtension.java:59)

quarkus-bot[bot] avatar Apr 27 '24 00:04 quarkus-bot[bot]

@gastaldi I think the reflection increase is expected.

zhfeng avatar Apr 27 '24 01:04 zhfeng

@zhfeng that's a lot of increase for a lot of applications so we need a certainty here. I'm not entirely sure why we end up increasing this so much.

Maybe @zakkak can help us understand what's going on.

BTW, I would rather have the revert in a separate PR so that we revert right away. I don't want us to take the risk of having this patch released somehow.

gsmet avatar Apr 29 '24 08:04 gsmet

Thanks @gsmet - I seperate revert commit in

  • https://github.com/quarkusio/quarkus/pull/40334

zhfeng avatar Apr 29 '24 09:04 zhfeng

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit de2dbb25bad4dd0f036543e9a2219dbf328c4588.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
Native Tests - Data5 Build Failures Logs Raw logs :mag:
Native Tests - Main Build Failures Logs Raw logs :mag:

Full information is available in the Build summary check run. You can consult the Develocity build scans.

Failures

:gear: Native Tests - Data5 #

- Failing: integration-tests/jpa-postgresql integration-tests/jpa-postgresql-withxml 

:package: integration-tests/jpa-postgresql

io.quarkus.it.jpa.postgresql.ImageMetricsITCase.verifyImageMetrics line 16 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	org.opentest4j.AssertionFailedError: Expected analysis_results.methods.reflection to be within range [4367 +- 3%] but was 4663 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [201 +- 3%] but was 338 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)
	at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.verifyImageMetrics(NativeBuildOutputExtension.java:59)

:package: integration-tests/jpa-postgresql-withxml

io.quarkus.it.jpa.postgresql.ImageMetricsITCase.verifyImageMetrics line 15 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (2 failures)
	org.opentest4j.AssertionFailedError: Expected analysis_results.methods.reflection to be within range [4551 +- 3%] but was 4845 ==> expected: <true> but was: <false>
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [170 +- 3%] but was 307 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)
	at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.verifyImageMetrics(NativeBuildOutputExtension.java:59)

:gear: Native Tests - Main #

- Failing: integration-tests/main 

:package: integration-tests/main

io.quarkus.it.main.ImageMetricsITCase.verifyImageMetrics line 15 - History - More details - Source on GitHub

org.opentest4j.MultipleFailuresError: 
Multiple Failures (1 failure)
	org.opentest4j.AssertionFailedError: Expected analysis_results.fields.reflection to be within range [496 +- 3%] but was 633 ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:80)
	at org.junit.jupiter.api.AssertAll.assertAll(AssertAll.java:58)
	at org.junit.jupiter.api.Assertions.assertAll(Assertions.java:3012)
	at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.verifyImageMetrics(NativeBuildOutputExtension.java:59)
	at io.quarkus.test.junit.nativeimage.NativeBuildOutputExtension.verifyImageMetrics(NativeBuildOutputExtension.java:46)

Flaky tests - Develocity

:gear: JVM Tests - JDK 17 Windows

:package: integration-tests/grpc-hibernate

com.example.grpc.hibernate.BlockingRawTest.shouldAdd - History

  • Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:975)
	at com.example.grpc.hibernate.BlockingRawTestBase.shouldAdd(BlockingRawTestBase.java:59)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)

quarkus-bot[bot] avatar Apr 29 '24 10:04 quarkus-bot[bot]

We will discuss the merit of this PR later. For now we plan to fix the immediate issue with https://github.com/quarkusio/quarkus/pull/40365

gsmet avatar Apr 30 '24 11:04 gsmet

Is this PR still necessary?

gastaldi avatar May 09 '24 12:05 gastaldi

Is this PR still necessary?

I don't think so but we need @zhfeng to decide.

mmusgrov avatar May 10 '24 09:05 mmusgrov

For fixing #39283 , it is not needed. But if we still want to support system properties in the native mode, it is necessary.

zhfeng avatar May 10 '24 09:05 zhfeng

Maybe @zakkak can help us understand what's going on.

I don't see anything special going on. Registering more classes for reflection is expected to increase these metrics.

With a quick count over the rest of the classes as well I get a total of 192 methods being added for reflection (which were not being added before).

Assuming that even before this PR the registered methods were close to the threshold if I subtract 192 from the reported numbers I see that the result is below the 3% threshold.

zakkak avatar May 14 '24 12:05 zakkak