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

Persistent pool optimized for FDW #466

Merged
merged 7 commits into from
Jul 23, 2024
Merged

Persistent pool optimized for FDW #466

merged 7 commits into from
Jul 23, 2024

Conversation

miguelbranco80
Copy link
Contributor

Implements a connection pool that is designed specifically for the needs of FDW and Steampipe.
This connection pool tries to keep connections active/alive for as long as possible; this ensures that Steampipe caches, which are per connection, stay alive for as long as possible.
The connection pool has a total global limit on the number of connections. If a new connection needs to be established, it will synchronously try to remove the oldest connection that isn't currently borrowed by anyone.
In addition, it keeps a limit on the number of active connections to a single database - this is done to prevent a single "user" from taking over all available slots.
Finally, it has a background thread that checks the health state of connections in the pool; this picks up one connection at a time (that is not used recently), and uses the JDBC isValid(...) method to check its validity.

@miguelbranco80 miguelbranco80 merged commit 223461c into main Jul 23, 2024
6 checks passed
@miguelbranco80 miguelbranco80 deleted the persistent-pool branch July 23, 2024 14:35
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.

2 participants