-
Notifications
You must be signed in to change notification settings - Fork 404
Description
We reuse connections in connection-pools in a Last-in-First-Out order.
When we VCP_Get() a handle, and the remote close(s|ed) it, theory says that all other fd's deeper in the pool will suffer the same fate.
In practice there is a delta to ideal, due to when the remote's write(2) returned relative to tcp-xmit-buffering and how long time it took us to pull the data out of our tcp-recv-buffer before we recycled the handle.
When a recycled handle fails, it probably makes sense to prevent reuse of all handles deeper in the pool, and just leave them for the pool-waiter to reap.
A more productive strategy might be to dynamically estimate, per pool, how long a handle can sit in the pool, before the chance of reusing it drops below an acceptable probability (95% ? 99%? 99.9% ?) but for that to work, it is important to not "pollute" the input data to the estimator with any other failure modes than remoted closed.