-
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
io.quarkus.oidc.TokenStateManager called from event loop thread #19670
Comments
/cc @evanchooly, @pedroigor, @sberyozkin |
I think this might make #13239 difficult? |
@sberyozkin can you do the same thing here I did for the |
@stuartwdouglas Yeah, I was thinking I should try and copy that code you added and rename a bit :-), I'll give it a go |
I've started prototyping it, though may have to delay for a few days or so |
@danelowe Hi, please consider looking at #13239 when you get a chance - as you are experimenting with |
Thanks for working on this @sberyozkin. I've shifted to other work for now. By the time I get back to this, 2.3 might be released. When I get back to it, I will have a look at how I can make a generic solution. |
G'day @sberyozkin @stuartwdouglas, know this issue is closed but was wondering if there are any tips on the pattern to perform a blocking call in the TokenStateManager like saving a PanacheEntity? |
Replying to my own question, the answer is to use requestContext.runBlocking(()-> do blocking logic here) and annotate the method with @Blocking. |
@t-adrian thanks, I missed it, good you've figured it out |
Describe the bug
I'm trying to implement a custom
io.quarkus.oidc.TokenStateManager
that stores some tokens in Redis.I get
java.lang.IllegalStateException: The current thread cannot be blocked: vert.x-eventloop-thread-7
In CodeAuthenticationMechanism:
Expected behavior
Either call
TokenStateManager
methods from another thread, or allow for a reactive API in theTokenStateManager
interface such that a database can be called without throwing an error.Or document how it is to be achieved.
Actual behavior
I get
java.lang.IllegalStateException: The current thread cannot be blocked: vert.x-eventloop-thread-7
when calling redis to retrieve tokens.How to Reproduce?
Try something like:
Output of
uname -a
orver
Darwin Danes-MBP 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "15.0.2" 2021-01-19 OpenJDK Runtime Environment Corretto-15.0.2.7.1 (build 15.0.2+7) OpenJDK 64-Bit Server VM Corretto-15.0.2.7.1 (build 15.0.2+7, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.1.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 7.0.2 ------------------------------------------------------------ Build time: 2021-05-14 12:02:31 UTC Revision: 1ef1b260d39daacbf9357f9d8594a8a743e2152e Kotlin: 1.4.31 Groovy: 3.0.7 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 15.0.2 (Amazon.com Inc. 15.0.2+7) OS: Mac OS X 11.4 x86_64
Additional information
No response
The text was updated successfully, but these errors were encountered: