As demonstrated in https://github.com/sdeleuze/spring-boot-coroutines-demo, in annotated controller throwing a CancellationException result in a 5xx error. Since CancellationException means "normal cancellation of a coroutine", is it the expected behavior?
In functional controller, with such handler function:
suspend fun cancel(request: ServerRequest): ServerResponse {
throw CancellationException()
}
The related web endpoint never returns, that's unexpected and not consistent with the annotated variant (cc @poutsma). We should probably fix this, see https://github.com/sdeleuze/spring-boot-coroutines-demo/blob/master/src/test/kotlin/com/example/CoroutinesApplicationTests.kt#L63-L67 for a repro.
As demonstrated in https://github.com/sdeleuze/spring-boot-coroutines-demo, in annotated controller throwing a
CancellationExceptionresult in a 5xx error. SinceCancellationExceptionmeans "normal cancellation of a coroutine", is it the expected behavior?In functional controller, with such handler function:
The related web endpoint never returns, that's unexpected and not consistent with the annotated variant (cc @poutsma). We should probably fix this, see https://github.com/sdeleuze/spring-boot-coroutines-demo/blob/master/src/test/kotlin/com/example/CoroutinesApplicationTests.kt#L63-L67 for a repro.