reactor / BlockHound

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BlockHound doesn't detect UUID.randomUUID() blocking call on Windows 10

tomasz0801 opened this issue · comments

Expected Behavior

BlockHound should detect blocking call when UUID.randomUUID() is called on Windows 10.
Blocking call is detected correctly on Linux and macOS systems.

Actual Behavior

BlockHound does not detect blocking call UUID.randomUUID() but only on Windows 10.

Steps to Reproduce

  1. Create Java project and include reactor-core and blockhound dependencies
  2. Copy below code snipped
  3. Run main method
import reactor.blockhound.BlockHound;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;

import java.util.UUID;

public class ReactorMain {
    public static void main(String[] args) {
        BlockHound.install();
        Mono.fromSupplier(() -> {
            try {
                UUID.randomUUID();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return 1;
        }).subscribeOn(Schedulers.parallel()).block();
    }
}

Your Environment

  • Reactor version(s) used: 3.4.6
  • JVM version: AdoptOpenJDK 11.0.11+9 (problem occurs also on jdk 1.8)
  • OS and version: Windows 10

Same problem here with Windows 10, Reactor 3.4.14 and JDK 11.0.12.
Any hint to solve this problem, guys?
Blockhound throws the expected exception when I run the same project in Linux, but not on Win10.

no idea why that particular call is not detected on Windows specifically. I don't have a Windows machine on which I can investigate. I'm guessing BlockHound raw configuration is detecting an underlying call that UUID.randomUUID() is depending on, which doesn't happen on Windows? Maybe the SecureRandom used by that platform is different?

If you've identified that the use of randomUUID() is problematic in your codebase, I would suggest configuring BlockHound explicitly to disallow it.