It seems like there's an issue with Ktor CIO Serve...
# ktor
p
It seems like there's an issue with Ktor CIO Server engine leaking a
request-handler
coroutine in the event of an idle connection that has recently sent a larger than 1MB response being half-closed (closing the write side) and subsequently receiving a request on that half-closed connection (in our case, from a Ktor+OkHttp client with a connection pool which seems to ignore the TCP FIN and attempt the request anyway). Does this issue lie with Ktor CIO or with the client attempting to send the request some time (~1m15s for us, after the default 45s idle timeout) after the FIN from the half-close on idle?
a
Can you please share a code snippet that illustrates your issue?
p
Hopefully this makes sense.
a
It seems the issue is caused by the combination of the CIO server engine and the OkHttp client engine. Most likely, the issue is within the CIO server engine implementation.
p
I think so - OkHttp seems to ignore the half-closed connection and attempt to use it anyway. It could fix that but that wouldn't solve the potential race condition of CIO idle-closing the connection as a request comes in. Likely safer to full-close on timeout.
👍🏻 1
a
kodee loving 1