Skip to content

Error is not propagated. Mono hangs when StackOverflowError is thrown in map or flatMap #1118

@0v1se

Description

@0v1se

Expected behavior

StackOverFlow should be thrown

Actual behavior

java.lang.IllegalStateException: Timeout on blocking read for 5000 MILLISECONDS

Steps to reproduce

run strange method provided:

private void exception() {
    exception();
}

public void strange() {
    CompletableFuture<Integer> future = new CompletableFuture<>();
    future.complete(1);
    Mono<Integer> simple = Mono.fromFuture(future);//Mono.just(1)

    simple.map(r -> {
        exception();
        return r;
    }).block(Duration.ofSeconds(5));
}

Reactor Core version

3.1.5.RELEASE

JVM version (e.g. java -version)

java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions