Skip to content
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

Investigate possibility to integrate debug module with BlockHound #1031

Closed
qwwdfsad opened this issue Mar 7, 2019 · 4 comments
Closed

Investigate possibility to integrate debug module with BlockHound #1031

qwwdfsad opened this issue Mar 7, 2019 · 4 comments
Assignees

Comments

@qwwdfsad
Copy link
Collaborator

qwwdfsad commented Mar 7, 2019

https://github.com/reactor/BlockHound/blob/master/docs/custom_integrations.md

We should investigate whether we can opt-in for block hound by default without explicit user actions (besides enabling debugger) or a least to provide a simple switch "detect blocking calls" in the debugger.

@qwwdfsad qwwdfsad self-assigned this Mar 7, 2019
@bsideup
Copy link
Contributor

bsideup commented May 5, 2019

FYI this is how Reactor itself now integrates with BlockHound:
https://github.com/reactor/reactor-core/blob/4faaa6e6ebe7671064c89f50a9cbc0495480b219/reactor-core/src/main/java/reactor/core/scheduler/ReactorBlockHoundIntegration.java

(There is no code for Reactor 3.3.x in the BlockHound itself, and reactor-core controls how it should be integrated)

@elizarov
Copy link
Contributor

@bsideup Thanks. We'll get back to it after the Flow release.

@elizarov elizarov modified the milestone: 1.3.0-alpha May 23, 2019
@bsideup
Copy link
Contributor

bsideup commented Oct 3, 2019

FYI BlockHound 1.0.0.RELEASE is out (on Maven Central):
https://github.com/reactor/BlockHound/releases/tag/1.0.0.RELEASE

bsideup added a commit to reactor/BlockHound that referenced this issue Jan 23, 2020
This change adds a new API to mark threads as "dynamic",
which means that the blocking check should call `threadPredicate
 once again before reporting the blocking call.

Example usage:
```java
b.addDynamicThreadPredicate(DynamicThread.class::isInstance);

b.nonBlockingThreadPredicate(p -> p.or(thread -> {
    return thread instanceof DynamicThread && ((DynamicThread) thread).isNonBlocking;
}));
```

where `DynamicThread#isNonBlocking` is a field that reflects the current "mode".

It helps frameworks like Kotlin's Coroutines where a thread may change from blocking
to non-blocking dynamically (see Kotlin/kotlinx.coroutines#1031)
@bsideup
Copy link
Contributor

bsideup commented Jan 23, 2020

I just merged the support for dynamic predicates that should unblock Kotlin from progressing.
It will be released soon, and meanwhile you can try it from our SNAPSHOTs repository (https://repo.spring.io/snapshot/, version 1.0.1.BUILD-SNAPSHOT)

I will appreciate if you give it a try before the release and let us know if there is anything else that blocks you from progressing.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants