ConnectionPool: avoid undefined behavior for hash iteration
Perl 5.18 stable and later (commit
a7b39f85d7caac) introduced a
warning for restarting `each` after hash modification. While we
accounted for this undefined behavior and documented it in the
past, this may still cause maintenance problems in the future
despite our current workarounds being sufficient.
In any case, keeping idle sockets around is cheap with modern
APIs, and conn_pool_size was introduced in 2.72 to avoid
dropping idle connections at all; so _conn_drop_idle may
never be called on a properly configured tracker.
Mailing list references:
<CABJfL5jiAGC+5JzZjuW7R_NXs1DShHPGsKnjzXrPbjWOy2wi3g@mail.gmail.com>
<
20160114024652.GA4403@dcvr.yhbt.net>