Ktor server When a request is timed out, should th...
# ktor
j
Ktor server When a request is timed out, should the handling of the request fail?
Copy code
post("/foo") {
    println("foo 1")
//... requests takes long time to send and times out
    val receivedData = call.receiveText() // gets to read the body when the request timed out
    println("Data received: $receivedData")
    call.respond(HttpStatusCode.OK, "ok")
}
I get partial result from a json-string, which is not possible to deserialize. Which is a bit weird
a
Your problem might be similar to KTOR-7977. Can you reproduce the problem with the OkHttp engine?
j
I would guess it doesn't matter which client-engine you use, since it's the server handling that is unexpected
a
When I execute your test, it prints
Data received:
from the route handler. Do you expect an exception to be thrown?
j
Yes, i would expect it to throw some kind of expection. But it might be that it's not wanted. But somehow I would expect it to throw an exception when the client has closed the connection and the request has not been fully read
a
I've filed an issue to address this problem.
j
Thank you 🙌