Skip to content

Fix for passing the context in pgxpool.ConnectConfig to BeforeConnect - #1484

Merged
jackc merged 1 commit into
jackc:v4from
dharju:v4
Jan 31, 2023
Merged

jackc merged 1 commit into
jackc:v4from
dharju:v4

Conversation

@dharju

@dharju dharju commented Jan 30, 2023

Copy link
Copy Markdown

Fixes bug where the context passed to a config.BeforeConnect function (of type func(context.Context, *pgx.ConnConfig) error) is not the same as the context passed to the invoking pgxpool.ConnectConfig(ctx, config) function. This happens when config.MinConns is greater than 0.

This bug was introduced in 4.17 from this commit line: https://github.com/jackc/pgx/pull/1213/files#diff-dfb45ae842e6d6603aae7f6631cd38ee1c56d2053289b1914aff4bef35e39d2dR243

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