-
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
Programmatic Cache API does not preserve Vertx Duplicate Context #39515
Comments
/cc @gwenneg (cache) |
Looking closer at #37077, I noticed that the |
Pinging @cescoffier since you were the one who implemented the current fix in the |
@markusdlugi Would you like to open a PR to illustrate the change? It makes sense, but I won't have time to do it soon. |
I'd love to do that but I'm gonna be on vacation soon, so I'd only be able to provide a PR in a couple of weeks. If noone gets around to pick up the topic until that point in time then I'll give it a try. |
Describe the bug
We noticed that using the programmatic cache API via
cache.getAsync()
leads to the Vertx duplicate context being lost. This can lead to undesired behavior, especially when relying on Hibernate Reactive which stores its session in the context. In our application, we frequently saw the exceptionjava.lang.IllegalStateException: Illegal pop() with non-matching JdbcValuesSourceProcessingState
, but of course this will depend on the specific application.Expected behavior
The context should be preserved.
Actual behavior
The context is lost, leading to problems for applications or modules that rely on the context, e.g. Hibernate Reactive.
How to Reproduce?
https://github.com/markusdlugi/cache-context-reproducer/tree/master
ReproducerTest
and observe that the test failsGreetingResource
and observe that the test now passesOutput of
uname -a
orver
No response
Output of
java -version
openjdk version "21.0.2" 2024-01-16 LTS
Quarkus version or git rev
3.8.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Additional information
A similar bug has already been reported and fixed for the annotation-based cache (#37078), so most likely the same treatment is necessary for the programmatic API.
The text was updated successfully, but these errors were encountered: