Hey everyone, Is this supposed to result in a gra...
# ktor
s
Hey everyone, Is this supposed to result in a graceful shutdown? Similar to if I would've called
ApplicationEngine#stop
? Currently, I am seeing all open requests result in
CancellationException
.
2022-06-02 205227.779 [eventLoopGroupProxy-4-3] DEBUG ktor.application - 500 Internal Server Error: GET - /health. Exception class kotlinx.coroutines.JobCancellationException: LazyStandaloneCoroutine was cancelled
This seems to be invoked to trigger the graceful shutdown. https://github.com/ktorio/ktor/blob/main/ktor-server/ktor-server-host-common/jvmAn[…]ix/src/io/ktor/server/engine/EngineContextCancellationHelper.kt But the cancellation of
enviroment.parentCoroutineContext
seems to cancel the
userContext
in
NettyApplicationEngine
.
Hey @e5l, Sorry for tagging you but I was wondering if I should create a ticket for this on YouTrack? It seems like strange default behavior to me since I cannot imagine many scenarios where it'd be desirable to send the user a cancellation error rather than gracefully shutting down. WDYT?
e
Yep, could you log an issue? We will take a look :)
👍 1
108 Views