-
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
Context Propagation issue #35842
Comments
/cc @FroMage (context-propagation), @evanchooly (kotlin), @geoand (kotlin), @manovotn (context-propagation) |
@brice-laurencin This same issue has been mentioned on stack overflow before. I think the reason context couldn't be propagated was because by nature parallelstream runs operations on the JVM's default ForkJoinPool of threads, which are not managed by Quarkus but the JVM itself. |
If that's the case then you are correct. The default ForkJoinPool cannot propagate contexts. |
Thanks! I'll test that. |
Well, what people said here is true. But the symptom here is that there's a ClassLoader issue, leading to two instances of the class |
Describe the bug
Trying the handle a collection from with
parallelStream
, calling a rest microprofile service ends up failing withjava.util.ServiceConfigurationError: org.eclipse.microprofile.context.spi.ThreadContextProvider: io.smallrye.context.jta.context.propagation.JtaContextProvider not a subtype
Expected behavior
Parallel processing works
Actual behavior
fails with
java.util.ServiceConfigurationError: org.eclipse.microprofile.context.spi.ThreadContextProvider: io.smallrye.context.jta.context.propagation.JtaContextProvider not a subtype
after a few callsHow to Reproduce?
run tests from https://github.com/brice-laurencin/quarkus-context-propagation-issue
Output of
uname -a
orver
Linux brice-work 6.2.0-32-generic #32-Ubuntu SMP PREEMPT_DYNAMIC Mon Aug 14 10:03:50 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)
GraalVM version (if different from Java)
n/a
Quarkus version or git rev
3.2.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 8.1.1 ------------------------------------------------------------ Build time: 2023-04-21 12:31:26 UTC Revision: 1cf537a851c635c364a4214885f8b9798051175b Kotlin: 1.8.10 Groovy: 3.0.15 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.7 (Eclipse Adoptium 17.0.7+7) OS: Linux 6.2.0-32-generic amd64
Additional information
It kind of works when there is no JPA/Hibernate in the project. I had to add the actual DB to reproduce the issue I faced with my actual project.
The text was updated successfully, but these errors were encountered: