-
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
Panache Reactive not working with Quarkus GraphQL #21111
Comments
Hi @hogmuzzle - thanks for this. Do you have a reproducer ? |
Hello, have the same issue here. (in quarkus 2.4.1.Final) Just have a test project (all in a reactive way) with the following dependencies :
I set a resource class which calls a PanacheRepository (something like Then my resource method should return the Uni. Everything works fine until 5 or 6 requests, then I get : Seems like a connection not released? Edit: I don't have a proper reproducer for you but I think that your tutorial https://quarkus.io/guides/getting-started-reactive#reactive-panache-entity should do the trick (just replace the RestResource with the GraphQL one) Edit 2: Actually I have created a reproducer for you : hibernate-reactive-panache-quickstart.zip Hope this help |
Hi @vnhim , can you please provide a reproducer? |
Hi @phillip-kruger, the reproducer is in the zip file on my previous comment (just your hibernate reactive quickstart with a graph ql resource instead of rest) |
Got it. Thanks, I'll have a look. |
Hi @phillip-kruger, any update on this ? |
Not yet. |
I simplified my project in order to provide a reproducer but the problem is gone and I can not send the whole project. I decided to use vertx pgclient + jooq sql builder. |
OK I manage to recreate this issue. I will debug when I start working on #21433 |
I have started investigating this, as part of making sure GraphQL does Uni in a non blocking manner as I thought that was the problem, however, even after I fixed that, so Uni now run on the event loop, this still happens. I also discussed with @cescoffier, but we might need the help of @Sanne . @Sanne - quick overview. When we create a GraphQL Endpoint that returns a Uni (in this case of a List of Fruit) that it finds using Hibernate reactive, it works for 5 tries and then hangs and timeout. If i manually create the List of fruits it works fine. In the screencast below you can see the log lile on the left, and the netstat of java processes on the right, that grows (non port 8080) until 5 and then hangs. After it hangs I can still execute the manual fruit request, but never the hibernate one again. |
@michalszynkiewicz f.y.i |
apologies I missed the first notification :) I'll have a look |
@phillip-kruger The number of calls (4 OK, fifth one fails) sounds suspiciously similar to an issue I have with panache in 2.7.1/2.7.2: #23804 2.7.0 seems to be working fine. |
Thanks @Sanne and @michalszynkiewicz ! |
When trying to debug it I see InternalStateAssertions#assertCurrentThreadMatches during the session close |
@phillip-kruger is it normal that the graphql endpoint is executed on the worker thread even though it returns a Uni? |
No, that is being fixed, but even with that fix , in my local environment, same problem when using it with reactive hibernate |
is it still failing on this assertion then? |
I am not sure. I'll commit my branch tomorrow then you can check? |
@michalszynkiewicz - I still have not committed my branch, trying to get it to a working state. I'll ping you once it's ready |
Thought I was doing something wrong. |
I still have this issue in 2.8.0.Final. Is there anyone know how to workaround |
@phillip-kruger Is there really no workaround available? I am also facing this issue. |
@Sanne - did you have a chance to look at this? |
@dawi no workaround a.f.a.i.k |
Also seeing the same issue with 2.8.0 using the graphql For example, with reactive panache @Entity
public class SoupOpera extends PanacheEntityBase {
public String title;
}
@Entity
public class Episode extends PanacheEntityBase {
public Long soupOperaId;
public String title
}
@GraphQLApi
public class SoupOperaResource {
@Query
@Description("Fetch soup opera by id")
public Uni<SoupOpera> findSoupOperaById(Long id) {
return SoupOpera.findById(id)
}
public Uni<List<Episode>> episodes(@Source SoupOpera soupOpera) {
return SoupOpera.list('soupOperaId', soupOpera.id)
}
} Then If I run below graphql query query findSoupOperaById(id: 1) {
title
episodes {
title
}
} Quarkus will fail with below error
Also found similar issue here: dvddhln/quarkus-reactive-hibernate-graphql-crud#1 |
This should be fixed in the next version. I'll add a test case for this scenario specifically. see #25194 |
@phillip-kruger Still facing the same issue with latest version Will it be fixed in quarkus version Additional details - uname -a
java -version
mvn --version
psql --version
Thank you. |
Yes, aiming for 2.10 |
What's the expected release date for version 2.10? |
Not sure yet. Keep your eye on https://github.com/quarkusio/quarkus/wiki/Release-Planning |
Good news, I just tested this reproducer with snapshot (main branch) and it's working (or at least it goes past 4 requests :)) If anyone here is keen to test, use the main branch (999-SNAPHOT) and let me know if it's not working. CR1 for 2.10 should also be release in a few weeks and should contain the fix. /cc @hogmuzzle @vnhim @RuggeroDAlo @indiealexh @KienDangTran @dawi @joedevgee @zbhavyai @michalszynkiewicz @Sanne @cescoffier |
I made a mistake when testing, #23804 still seems broken, 4 messages processed with panache and then nothing, pure hibernate is fine |
Describe the bug
First query works fine. Others throw IllegalStateException: HR000061: Session is currently connecting to database
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
2 Methods in @GraphQLAPI and call them in one query which is common for gql. The first works fine but others fail.
Output of
uname -a
orver
5.13.0-20-generic #20-Ubuntu SMP Fri Oct 15 14:21:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.12" 2021-07-20
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.3.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)3.8.1
Additional information
No response
The text was updated successfully, but these errors were encountered: