trying to set some connection help in exograph#36
Merged
Conversation
|
Version bump detected: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces enhanced configurability and observability to the database connection pooling system, with a focus on making pool timeouts and lifetimes configurable via environment variables and code. It also adds the ability to query the pool's status, and improves compatibility with serverless databases by supporting custom connection recycling and lifetime policies. The changes are backward compatible, preserving legacy interfaces while enabling more advanced configuration.
Database Pool Configuration and Observability
PoolConfigstruct indatabase_pool.rsto allow fine-grained configuration of pool size, wait timeout, create timeout, recycle timeout, and max connection lifetime. These can be set via environment variables or directly in code. (libs/exo-sql/src/sql/connect/database_pool.rs,crates/common/src/env_const.rs) [1] [2]PoolStatusstruct and apool_status()method toDatabaseClientManagerto allow querying the current state of the connection pool (max size, current size, available, waiting). (libs/exo-sql/src/sql/connect/database_pool.rs,libs/exo-sql/src/sql/connect/database_client_manager.rs) [1] [2]Pool Creation and Configuration Propagation
database_helper.rs) and in the SQL library. This includes new methods likefrom_url_with_pool_configandcreate_with_config, while preserving legacy methods for backward compatibility. (crates/postgres-subsystem/postgres-core-resolver/src/database_helper.rs,libs/exo-sql/src/sql/connect/database_client_manager.rs,libs/exo-sql/src/sql/connect/database_pool.rs) [1] [2] [3]Timeouts, Recycling, and Logging
libs/exo-sql/src/sql/connect/database_pool.rs)Dependency and Version Updates
deadpool-postgresdependency to explicitly enable thert_tokio_1runtime feature for compatibility, and bumped the workspace version to0.30.1. (Cargo.toml) [1] [2]Public API Extensions
PoolConfigandPoolStatusfrom the crate root for external use, making it easier for other parts of the system or downstream users to configure and monitor the pool. (libs/exo-sql/src/lib.rs)