Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix TestPoolBackgroundChecksMinConns and NewConnsCount #1693

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

jameshartig
Copy link
Contributor

Previously it was checking TotalConns but that includes ConstructingConns. Instead it should directly check IdleConns so the next Acquire takes one of those and doesn't make a 3rd connection. The check against the context was also wrong which prevented this from timing out after 2 minutes.

This also fixes a bug where NewConnsCount was not correctly counting connections created by Acquire directly.

Fixes #1690

Previously it was checking TotalConns but that includes ConstructingConns.
Instead it should directly check IdleConns so the next Acquire takes one of
those and doesn't make a 3rd connection. The check against the context was
also wrong which prevented this from timing out after 2 minutes.

This also fixes a bug where NewConnsCount was not correctly counting
connections created by Acquire directly.

Fixes jackc#1690
@jackc jackc merged commit e665f74 into jackc:master Jul 22, 2023
14 checks passed
@jameshartig jameshartig deleted the fix-1690 branch July 22, 2023 13:41
@jackc
Copy link
Owner

jackc commented Jul 22, 2023

Thanks!

@jameshartig
Copy link
Contributor Author

@jackc could you include this in a release when you have a chance?

@jackc
Copy link
Owner

jackc commented Aug 5, 2023

@jameshartig Released in v5.4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows CI failure with TestPoolBackgroundChecksMinConns
2 participants