-
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
Fix type/unremovable for reactive client CDI beans, make DataSource beans application-scoped, more consistent exceptions for unconfigured datasources #37906
Conversation
/cc @gsmet (hibernate-orm) |
This comment has been minimized.
This comment has been minimized.
@yrodiere the CI failures seem related, no? |
Might be, but I was on PTO. I'll have a look :) |
As they should be, like their non-mutiny counterpart. See https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Should.20mutiny.20reactive.20clients.20be.20unremovable.3F
…ertx.mutiny.sqlclient.Pool Because there's no reason not to, considering we allow similar things for non-mutiny reactive SQL clients. See also https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Should.20mutiny.20reactive.20clients.20be.20unremovable.3F
EDIT: I reported this as quarkusio/build-reporter#144 Unrelated, but there's something wrong with the build reporter; we get this: Even though the error message is much more detailed in the logs:
|
Turns out Liquibase tests were incorrect as they were setting quarkus.datasource.devservices.enabled, which means that in fact the datasource *was* configured and detected by the Agroal extension... Fixing that reveals that Liquibase will simply fail the boot when a datasource is unconfigured.
So that we'll be able to postpone initialization to first access in some cases, instead of doing it on startup. This could be useful in particular for deactivated datasources: we don't want to initialize those on startup, but we do want them to fail on first use. An alternative would have been to represent deactivated datasources with a custom implementation of AgroalDataSource, like we currently do with UnconfiguredDataSource, but that solution has serious problems, in particular when we "forget" to implement some methods: see quarkusio#36666
… relevant config keys We're going to use this in interactions between Hibernate ORM and Agroal datasources.
1. To preserve the type of the exception, since we react differently to ConfigurationException for example. 2. To make testing cleaner.
Critically, this opens the way to handling other datasource access problems, e.g. deactivated datasources.
d8b801f
to
989ce28
Compare
Fixed and force-pushed, it should work now. It was simply an incorrect assertion (the error message on Oracle is different from other reactive SQL clients). |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. You can consult the Develocity build scans. |
Merging, thanks! |
These are various prerequisites for #37265 #36666
Best reviewed commit by commit.
I thought it would be a good idea to merge it early (assuming tests pass), otherwise the PR for #37265 is going to be quite big.
And these changes kind of make sense independently from #37265, I think.
Note:
NoConfigTest
.