-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Mark Scheduler threads to warn uses of block() inside one #1102
Labels
type/enhancement
A general enhancement
Milestone
Comments
simonbasle
added a commit
that referenced
this issue
Mar 2, 2018
simonbasle
added a commit
that referenced
this issue
Mar 2, 2018
simonbasle
added a commit
that referenced
this issue
Mar 8, 2018
`block`, `blockOptional`, `blockFirst`, `blockLast`, `toIterable` and `toStream` all check if the executing thread is NonBlocking and throw an `IllegalStateException` if it is.
fixed by 92df4ab |
This was referenced Jan 11, 2019
[docs] Document threading model in Spring WebFlux [SPR-16538]
spring-projects/spring-framework#21081
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We frequently observe users invoking Mono/Flux.block calls inside WebFlux Netty thread, or inside Schedulers.parallel()/Schedulers.single().
One solution would be to mark Threads via a ThreadFactory that extend Thread via a marking subclass, so later introspection via
Thread.currentThread() instanceof NonBlockingThread
could evaluate to true and even log or throw if Mono/Flux.block is called.Encapsulation ideas are open, but 2 constraints to be useful would be:
Schedulers.isInNonBlockingThread()
The text was updated successfully, but these errors were encountered: