-
Notifications
You must be signed in to change notification settings - Fork 2.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
Unactionable warning when booting Hibernate Reactive #45263
Comments
/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive) |
This typically happens when we're not able to reach the DB on startup, and I don't think we have such test cases for ORM -- it is technically not supported yet.
I don't think so, since the version we're not able to retrieve is the actual version of the DB we're connecting to. No way to hardcode that.
We could add a hint such as "is the database reachable?", but beyond that there's not much we can do. This warning happens either if the DB is unreachable on startup (which is technically not supported yet) or if there is a bug on our side. In this case I wonder if Hibernate Reactive just doesn't have the same version detection code that ORM has, at least when the datasource isn't JDBC-enabled. Because the version detection code in ORM is purely JDBC-based. FWIW the detection happens here in Quarkus: Lines 101 to 117 in 6daa2ea
And is fed information generated by this code in Hibernate ORM: https://github.com/hibernate/hibernate-orm/blob/748fa8f7e1cafae4d60618d9082e3523ae3cf7b2/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/JdbcEnvironmentInitiator.java#L162-L171 Note that we'll change that code a bit once we upgrade to ORM7, so that the dialect itself is in charge of detecting the version (which it can do more finely): https://github.com/quarkusio/quarkus/pull/43764/files#diff-86d161403825b101dd6e16f36ea3588690195d15079b74becd72409f3ab173a5L109-R109 |
Yes, Hibernate Reactive has it's own way to detect the database: https://github.com/hibernate/hibernate-reactive/blob/37d57f6429fc20c5cc1e30f5fc22c6cde343d714/hibernate-reactive-core/src/main/java/org/hibernate/reactive/provider/service/NoJdbcEnvironmentInitiator.java#L81 We basically recreate the dialect but override the resolution info. Quarkus seems to skip some steps when using Hibernate Reactive (it makes sense because we don't use JDBC) and
Let's try not to forget about Hibernate Reactive when we do this. |
Can you please add a rejecting review on my PR mentioning that, so I don't forget? |
But doesn't the warning come from this very code? FWIW, I'm running the tests with a container started so I would expect them to be able to contact the database. |
No, the warning comes from QuarkusRuntimeInitDialectFactory#checkActualDbVersion, and the log happens because QuarkusRuntimeInitDialectFactory#buildDialect has not being called before (and therefore the actual db version has not been initialized). |
When running the Hibernate Reactive ITs in
integration-tests/hibernate-reactive-postgresql
, I get the following warning:Two questions:
integration-tests/jpa-h2
.The text was updated successfully, but these errors were encountered: