Need help with BlockHound?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

888 Stars 53 Forks Apache License 2.0 167 Commits 27 Opened issues


Java agent to detect blocking calls from non-blocking threads.

Services available


Need anything else?

Contributors list


Travis CI Gitter

Java agent to detect blocking calls from non-blocking threads.

How it works

BlockHound will transparently instrument the JVM classes and intercept blocking calls (e.g. IO) if they are performed from threads marked as "non-blocking operations only" (ie. threads implementing Reactor's

marker interface, like those started by
). If and when this happens (but remember, this should never happen!:stuckouttonguewinkingeye:), an error will be thrown. Here is an example: ```java // BlockHound.install();

Mono.delay(Duration.ofSeconds(1)) .doOnNext(it -> { try { Thread.sleep(10); } catch (InterruptedException e) { throw new RuntimeException(e); } }) .block(); ```

Will result in:

reactor.blockhound.BlockingOperationError: Blocking call! java.lang.Thread.sleep
    at java.base/java.lang.Thread.sleep(Native Method)
    at com.example.Example.lambda$exampleTest$0(
Note that it points to the exact place where the blocking call got triggered. In this example it was

Getting it

Download it from Maven Central repositories (stable releases only) or


repositories {
  // maven { url '' }
  // maven { url '' }

dependencies { testCompile '$LATEST_RELEASE' // testCompile '$LATEST_MILESTONE' // testCompile '$LATEST_SNAPSHOT' }



||| |-|-| |

|| |
|| |

Built-in integrations

Although BlockHound supports the SPI mechanism to integrate with, it comes with a few built-in integrations: 1. Project Reactor
Version 3.2.x is supported out of the box.
Starting with

version 3.3.0, there is a built-in integration in Reactor itself that uses the SPI. 2. RxJava 2 is supported.
RxJava 3 and further versions of RxJava will require an SPI to be implemented, either by the framework or user. See this PR to RxJava with an example of the SPI's implementation.

Quick Start

See the docs.

Licensed under Apache Software License 2.0

Sponsored by Pivotal

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.