-
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
Graphql client initializing VertX cache even with vertx caching disabled #28875
Comments
/cc @gwenneg, @jmartisk, @phillip-kruger |
This seems to happen because the client builder isn't able to locate the existing Vert.x instance (managed by Quarkus) and thus it builds a new one for itself (and in such case the configuration won't be applied, it is just created with default settings). |
The problem is related to the fact that you're invoking the GraphQL client in a I'm not sure if this can be resolved though - the fix would probably be somewhere in the Vert.x extension. Hopefully @cescoffier can comment. |
Or maybe the Vertx instance is initialized, but the |
I am very surprised by this behavior as things like this should just work. Also TBH, I think the problem is different as |
Should not be related to the startup event, I only put it there to show the issue in the reproducer. |
If it's not set, the library tries to use If this doesn't work in Quartz either, then the problem is really that the threads executing the startup callback and Quartz events are not set up to see the Vert.x context. But I don't know how we should attempt to locate it in such case. Perhaps some recorder action that stores a reference to the Vertx instance into a static variable during boot? I can try experimenting with it next week. |
Vert.x integration does work in these settings, otherwise most of out other extensions would fail |
OK, thanks for the update, I just tested without startup event or quartz, calling graphql client directly in rest resource where the issue does not occur, confirming it is scoped (at least) to quartz, startup event whereas IMO quartz is more critical than startup event which has limited usages of graphql client (I assume) |
Btw. as a workaround, you should be able to |
@jmartisk Thanks a lot for the workaround. :) Will give it a try soon. |
I've submitted a PR with a potential fix, see smallrye/smallrye-graphql#1605 |
@jmartisk when creating your own Vert.x instance for such kind of use case, I recommend:
|
@cescoffier good point, I'll apply that, thanks |
Maybe we should have some common utility in Smallrye that creates such a custom Vert.x instance? |
I don't know if any other SR project does this. If yes, then it might make sense, but AFAIK only the GraphQL client does this atm. |
This will be resolved by upgrading to SmallRye GraphQL either 1.8.3 or 1.9.0 (there will be a little Quarkus-side code change along with it) |
Describe the bug
With latest Quarkus 2.13.3.Final, when using quarkus-smallrye-graphql-client with vertx caching disabled by
Starting quarkus application in docker with readonly fs by
I get error
Not sure if graphql client does not work with disabled vertx cache or if it is missing to respect
Reproducer based on microprofile-graphql-client-quickstart: https://github.com/syr/code-with-quarkus
Expected behavior
Quarkus application should start up and use graphql client without errors.
Actual behavior
How to Reproduce?
Reproducer based on microprofile-graphql-client-quickstart: https://github.com/syr/code-with-quarkus
Reproduced by
Output of
uname -a
orver
No response
Output of
java -version
openjdk version "17.0.2" 2022-01-18 OpenJDK Runtime Environment Temurin-17.0.2+8 (build 17.0.2+8) OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (build 17.0.2+8, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.13.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.2
Additional information
related to #28094
The text was updated successfully, but these errors were encountered: