Well, that was interesting. An unclear timeout (af...
# ktor
j
Well, that was interesting. An unclear timeout (after 10 seconds) on requests that streamed the response (with
respondBytesWriter
) using the Netty Engine. Initial tests using
curl
did not trigger the failure.
Turns out it was caused by the Compression plugin, combined with a Netty
responseWriteTimeoutSeconds
that defaults to 10 seconds.
So the fix was to either increase that timeout in the Netty configuration,
Copy code
embeddedServer(Netty, env) {
    responseWriteTimeoutSeconds = 60
}
or to disable compression for the requests that use
WriteChannelContent
Copy code
install(Compression) {
  condition {
    it !is OutgoingContent.WriteChannelContent
  }
}
Postman gave a
socket hang up
error, browser gave an
ERR_EMPTY_RESPONSE
, and nothing was visible in the ktor logging