Using Spring Boot 2.4.2

```@SpringBootApplication class DemoApplication

fun main(args: Array) { runApplication(*args) }

@Configuration class Controller { @Bean fun router() = coRouter { GET("/cancel") { throw CancellationException() } } }

@RestController class RestController { @GetMapping("/rest-cancel") suspend fun restCancel() : Unit = throw CancellationException() }


It is a simple example to reproduce the strange behaviour

When I make a rest call to RestController by using curl I see that in my console:

time curl http://localhost:8080/rest-cancel 12:27:21


Executed in 22.69 millis fish external usr time 3.35 millis 109.00 micros 3.24 millis sys time 4.85 millis 739.00 micros 4.11 millis

And Spring has logged this exception. This behaviour that I've expected.

Okay, now I request endpoint handled by coRouter:

time curl http://localhost:8080/cancel ```

This request is "in pending", I don't get a response immediately and even after five minutes.

I've expected the same behaviour as @RestController provided.

Comment From: sdeleuze

Sorry for the delay. With Spring Framework 6.0.13, I observe the same behavior on both endpoints.