-
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
Service binding doesn't work reliably ever since support for inactive datasources has been introduced #44297
Comments
/cc @yrodiere @radcortez |
Bear with me, I have never used service binding, but:
You are expecting the datasource to not be deactivated, even though no URL was configured? But that means the datasource won't work... Do you just want the app to start without error, but fail on first request? |
No, I expect that environment variables set by the service binding operator are used and they contain the datasource URL (or they contain link to where the ds URL value is, don't remember how it works). There is some race. Regarding |
For context @yrodiere , our test requests entity from database and receives it, so no failure is expected. |
Okay. The checking of whether a datasource is active (and its initialization, when active) happens on CDI startup now. If service binding is manipulating config concurrently to CDI startup, or as part of CDI startup (CDI bean startup order is undefined), that could explain the problem. @iocanel could you please point us to how/where the datasource URL is set in the service binding extension(s)?
That label was just because I was waiting for your answer... Nobody is questioning whether it's a bug, I'm not sure why you're bringing this up. |
Sorry. |
It looks that information in a specific file on the file system - see this for example |
I think they are just config sources like any other (judging by |
I haven't touched that code since the service binding operator got deprecated. |
Correct |
I was wondering the same... |
lets make sure we dont conflate deprecation of service binding operator with support for service binding API's. I'll check on where service binding apis support actually is outside openshift setup. But that still leaves a concerns on why the new "inactive" somehow causes race conditions - that shouldn't happen? |
@yrodiere I can help you to run it against OCP if you want (give you temporary access to OCP cluster inside VPN), but as I said, it's flaky, it won't happen everytime, so you will need patience. |
I don't see how the new "inactive" stuff could be the root cause. Though introducing that feature required to change when exactly we check the JDBC URL (we do it earlier, I think, during CDI initialization)... so maybe that made some pre-existing race condition between CDI init and config more visible? Seems unlikely, but at this point it's all I have :/
I'm afraid I'll also need an ungodly amount of time... And without a debugger I'm not even sure it would help investigate. Could you perhaps enable more logging so that we can compare what happens on your CI when the bug appears and when it doesn't? I'm thinking of enabling TRACE or at least DEBUG for EDIT: Oh, and also |
Hey @Ladicek @radcortez , can you confirm configuration doesn't depend on CDI at all and thus should be initialized completely once CDI starts initializing beans? I.e. do you know if the relative order beteen these two events is clearly defined?
|
Config does not depend on CDI in any way, yes, but I'm not sure if we have a defined ordering between runtime config init and runtime CDI init. |
Yes, Config does not depend on CDI in any way, but we had cases where we added such dependencies, which I've removed. I think we don't have such cases anymore. Remember that In the presented code, the |
It's bit problematic because if QE periodic builds are going to have failures, I need to get message across the team it's expected. Perhaps I'll just create job that runs in many iterations so that I can get required logs. I'll report back next week. |
Describe the bug
Now, this is very hard to reproduce for me, but our periodic builds testing service binding fails pretty often now that #41929 is merged. It fails both in JVM and native mode, though native mode seems to fail more often. And both Hibernate ORM and Hibernate Reactive are affected.
Expected behavior
This makes using service binding in production tricky, because you never know how many attempts it will take to deploy pod (e.g. what constellation of starts will be and so on). So IMO if service binding is in place, datasource should not be deactivated.
Actual behavior
There are 2 different behaviors, one for Hibernate ORM, one for Hibernate Reactive. Both results on application startup failure.
Hibernate ORM (native mode logs):
Hibernate Reactive (native mode logs):
How to Reproduce?
Steps to reproduce the behavior:
git clone git@github.com:michalvavrik/quarkus-test-suite.git -b feature/sb-reactive-reproducer
quarkus-test-suite/service-binding/postgresql-crunchy-reactive
(for Hibernate Reactive) orquarkus-test-suite/service-binding/postgresql-crunchy-classic
(for Hibernate ORM)mvn clean verify -Dopenshift
Output of
uname -a
orver
RHEL 8
Output of
java -version
Temurin 21
Quarkus version or git rev
999-SNAPSHOT
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.9.4
Additional information
No response
The text was updated successfully, but these errors were encountered: