Skip to content

Timeout behavior in Mono.block(timeout) #3709

@ferrerogg

Description

@ferrerogg

As already posted in #3519 , it would be very useful to catch a more specific exception when Mono/Flux.block fails with an IllegalStateException, because this error could be likely retried later.
Catching and parsing the String message "Timeout on blocking read for ..." is a very ugly "fallback" solution for this use case.

Throwing an IllegalStateException with the same current message and nesting a TimeoutException exception (or other exceptions) could be a good option. This would not break other users experience who are already manually matching the exception message and would let other users to catch a specific root cause.
Of course, throwing a new RuntimeException specific subclass for timeout will be even better, if no other users are matching message and/or the current exception type

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions