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

Factory failure drains available connection max from pool #4

Closed
randall-fulton opened this issue Sep 7, 2022 · 2 comments · Fixed by #5
Closed

Factory failure drains available connection max from pool #4

randall-fulton opened this issue Sep 7, 2022 · 2 comments · Fixed by #5
Assignees

Comments

@randall-fulton
Copy link
Contributor

Issue

If the provided factory returns an error, the pool's total connection limit will permanently decrease by one. Provided this happens enough times, the pool can become deadlocked, with zero capacity.

Here is a playground example of the issue: https://go.dev/play/p/lAy0_uoKMFj

Notice after the first two failures (the number of max connections in the pool) the errors change, due to the pool itself never being able to attempt to fetch new connections.

Expected Outcome

When the factory fails, the reserved slot in the pool should be returned to the pool.

@randall-fulton
Copy link
Contributor Author

Working on a fix for this now.

@buraksezer
Copy link
Owner

Thank you for your contribution @randall-fulton

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 a pull request may close this issue.

2 participants