Closed kazu-yamamoto closed 1 month ago
@khibino This makes dug
's time rag smaller. But we can still notice the time rag, I guess.
@edsko network-run
uses gracefulClose
in network
. We feel a time rag when a client is finished because threadDelay
with 200ms is used. This patch starts with 1ms and increments it exponentially.
Your opinions are highly welcome.
Makes sense to me. I don't know how critical the maximum timeout out; as it stands, the patch might exceed it (by one round); could instead consider
let tmout' = tmout + delay
when (r == -1 && tmout' < tmout0) $ do
threadDelay (delay * 1000)
loop (delay * 2) tmout'
to check if the timeout that we are about to do would not exceed the max. But it probably doesn't really matter either way.
TL;DR: Fine with me :)
@edsko Thank you for your review. I would like to merge this PR as is.
Rebased and merged.
200ms is too long. So, wait for 1ms first, then 2ms, 4ms, 8ms, etc.