i’ve been trying to investigate a flaky CI test that sporadically fails because of ioOnClosedChannel
. it is difficult to reproduce locally, and i’ve only been able to reproduce the failure by artificially limiting the CPU percentage available to the mock servers to a very low percentage, like 3%, to simulate a GitHub Actions runner under high contention.
but i have been unable to make much progress investigating the issue because i have no idea how to log why a channel was closed in the first place! i thought perhaps the failure(_:)
case of the closeFuture
result might contain useful information. but the closeFuture
always reports “success”. so i do not know if there is faulty logic on my end and i am somehow checking-out bad connections on the client side, or if the server is just hanging up on its own due to low resources.
how to i detect which side a channel was closed from?