Draft
Conversation
Replace hardcoded pool constants with Default* named constants and add a PoolConfig struct + DefaultPoolConfig() constructor. Update OpenDBConnectionPool and OpenDBConnectionPoolForBackfill to accept variadic ...PoolConfig so all existing call sites continue to compile without changes.
Parses Go duration strings (e.g. "5m", "10s") from CLI flags or environment variables into *time.Duration ConfigKey. Follows the same pattern as SetConfigOptionLogLevel. Includes table-driven tests covering empty input, invalid strings, CLI args, and env vars.
Exposes --db-max-conns, --db-min-conns, --db-max-conn-lifetime, and --db-max-conn-idle-time flags (with matching DB_* env vars) that can be appended to any command's cfgOpts. Duration flags use the new SetConfigOptionDuration custom setter. Defaults mirror the existing Default* pool constants.
Adds DBMaxConns, DBMinConns, DBMaxConnLifetime, DBMaxConnIdleTime fields to ingest.Configs. buildPoolConfig() merges non-zero values over the defaults so zero values (unset flags) leave current behaviour unchanged. setupDeps now passes the pool config to both OpenDBConnectionPool and OpenDBConnectionPoolForBackfill.
Adds DBMaxConns, DBMinConns, DBMaxConnLifetime, DBMaxConnIdleTime to serve.Configs with a BuildPoolConfig() method (exported so cmd/serve.go can call it). initHandlerDeps and cmd/serve.go PersistentPreRunE now pass the pool config to OpenDBConnectionPool. Same buildPoolConfig logic as ingest: zero values leave defaults intact.
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.
What
[TODO: Short statement about what is changing.]
Why
[TODO: Why this change is being made. Include any context required to understand the why.]
Known limitations
[TODO or N/A]
Issue that this PR addresses
[TODO: Attach the link to the GitHub issue or task. Include the priority of the task here in addition to the link.]
Checklist
PR Structure
allif the changes are broad or impact many packages.Thoroughness
Release