``` for(i in 0..invocations){ launch {...
# ktor
v
Copy code
for(i in 0..invocations){
            launch {
                val response = client.call(host).response
                val result = mapper.readValue<FunctionResponse>(response.readBytes())
                val requestTime = response.responseTime.timestamp - response.requestTime.timestamp
                channel.send(ExecutionEvent(requestTime = requestTime, pause = result.pause))
            }
        }
e
Hi @Vinicius Carvalho, could you try to close the response after using it?
v
Hi @e5l I had a version of the snipped that I was doing that on the line before
channel.send
did not help
Another thing to note, the client then rejects any new requests
that for loop sits on a function that can be called repeatedly, and after the first invocation, subsequent invocations would not complete
Here's a gist with the service that I run
I call start(N) several times (doing some load testing on an endpoint). Later I get a report from the
tasks
list.
It works fine with
Apache
but with
CIO
the described behavior kicks in and it hangs after a few requests
Using ktor 1.1.3 BTW