Skip to content

fix(pgxpool): enforce MaxConnLifetime at Acquire time#2562

Closed
SAY-5 wants to merge 1 commit into
jackc:masterfrom
SAY-5:fix/pgxpool-acquire-maxconnlifetime
Closed

fix(pgxpool): enforce MaxConnLifetime at Acquire time#2562
SAY-5 wants to merge 1 commit into
jackc:masterfrom
SAY-5:fix/pgxpool-acquire-maxconnlifetime

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 19, 2026

MaxConnLifetime was only checked by the background health check, which inspects idle connections. On a hot pool a connection is constantly acquired and returned, so it is rarely idle when the check fires and can live well past MaxConnLifetime. This adds an isExpired check in the Acquire loop so the limit holds regardless of pool utilization.

Closes #2560

@arthurdotwork
Copy link
Copy Markdown
Contributor

Looks like a duplicate of #2561 😇

@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented May 21, 2026

Ack, closing in favor of #2561. Thanks for pointing it out.

@SAY-5 SAY-5 closed this May 21, 2026
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.

pgxpool: MaxConnLifeTime not enforced at Acquire time, potentially allowing connections to live indefinitely on hot pools

2 participants