-
Notifications
You must be signed in to change notification settings - Fork 9
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
Possible memory leak and failure to restore the observation scope when using a JPA repository from a GraphQL controller #41
Comments
Thanks for the report. I ran the code with With
With
With As the output shows, observations start in the order of I think this may be causing the @bclozel I also noticed from the output that the |
@ttddyy I'm not familiar with the difference between |
We also had problems in a small Spring Boot app when we left
This left our Given that the connection gets opened deep in the stack and closed several layers up, connection should be a sibling of Or you could decide you don't support the Open Session In View (anti-)pattern and include a warning to that effect in your documentation. |
@codingjourney Thanks for the details. |
The context
In my application (Spring Boot
3.2.6
), I'm using the GraphQL, Web and JPA starters.I have created a GraphQL controller, in which I interact with a JPA repository.
I have also enabled observability with Micrometer.
The issue
When I query my controller, everything executes successfully, but I can find this log line (formatted for clarity purpose) :
When I connect my application to an Open Telemetry with a Jaeger backend, just to check if everything is ok in terms of trace and spans, it seems that yeah, everything is ok :
This log is not generated if I remove interaction with my JPA repository.
It's also not generated if I annotate the method of my controller (the one annotated with
@QueryMapping
) with@Observed
, or if I set the propertyspring.jpa.open-in-view
tofalse
(something I prefer not to do).How to reproduce
You can find a sample application right here.
You can query the controller with these information :
http://localhost:8080/graphql
Additional comments
In the original ticket that I've created on Spring Boot project side, @bclozel added this comment, maybe it can give more info :
The text was updated successfully, but these errors were encountered: