Commit cc7ddf3
Fix MaxLifetimeDestroyCount and ping order for acquire-time expiry check
The acquire-time expiry check destroyed expired connections without
incrementing lifetimeDestroyCount, unlike the equivalent checks in
Conn.Release and checkConnsHealth. This undercounted retired connections
in pool stats and made TestPoolAcquireDestroysExpiredIdleConn fail.
Also move the expiry check ahead of the ping so an expired connection is
destroyed without first incurring a wasted ping round-trip.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 20578f5 commit cc7ddf3
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
622 | 631 | | |
623 | 632 | | |
624 | 633 | | |
| |||
636 | 645 | | |
637 | 646 | | |
638 | 647 | | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | 648 | | |
645 | 649 | | |
646 | 650 | | |
| |||
0 commit comments