spring-projects / spring-statemachine

Spring Statemachine is a framework for application developers to use state machine concepts with Spring.
1.54k stars 604 forks source link

AbstractPersistStateMachineHandler fails to handle event in webflux #949

Closed xJoeWoo closed 3 years ago

xJoeWoo commented 3 years ago
java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-epoll-1
    at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:83)
    at reactor.core.publisher.Mono.block(Mono.java:1703)
    at org.springframework.statemachine.support.AbstractStateMachine.resetStateMachine(AbstractStateMachine.java:719)
    at org.springframework.statemachine.recipes.persist.AbstractPersistStateMachineHandler.lambda$handleEventWithStateReactively$0(AbstractPersistStateMachineHandler.java:86)

The exception caused due to resetStateMachine is not reactively called in a reactive chain.

jvalkeal commented 3 years ago

Good catch, somehow blockhound didn't catch this or we've relaxed too much in it as there's still tests to block.

jvalkeal commented 3 years ago

Merged per 048e930a19faa499222f1376173b7d64c91069aa