Assume that you have fasthttp.Client with this config:
client := fasthttp.Client{
MaxIdleConnDuration: time.Minute*5,
// ...
}
when the server shuts down, we have a problem with go connsCleaner, which is started before connection is resolved. There is no actual connection due to the error, but we have goroutine that waits MaxIdleTimeoutDuration before runs out.
Perhaps is reasonable to move running the cleanup function after checking for errors?
Assume that you have
fasthttp.Clientwith this config:when the server shuts down, we have a problem with
go connsCleaner, which is started before connection is resolved. There is no actual connection due to the error, but we have goroutine that waitsMaxIdleTimeoutDurationbefore runs out.Perhaps is reasonable to move running the cleanup function after checking for errors?