Skip to content

Conversation

@andrew-lee-architect
Copy link

What kind of change does this PR introduce?

This PR adds the optional keepalive config option to PgConnectionConfig. This allows the user to configure and use the TCP keepalive feature on the actual postgres connection.

What is the current behavior?

Currently, there is no way to configure TCP keepalives on the postgres connection.

What is the new behavior?

Now, the user can configure TCP keepalive on the postgres connection.

Additional context

The motivating use case for me is using this crate with Amazon RDS with slowly changing data. Without TCP keepalives, AWS will drop the replication connection if there isn't any activity on the line after awhile.

Hopefully this is an uncontroversial change as it just exposes some thing already available to tokio-postgres.

@andrew-lee-architect andrew-lee-architect requested a review from a team as a code owner December 1, 2025 18:55
@imor
Copy link
Contributor

imor commented Dec 2, 2025

@andrew-lee-architect could you please fix the failing tests.

@abhiaagarwal
Copy link

Nice, I've been running into this issue as well, thanks for fixing it 👍

@andrew-lee-architect
Copy link
Author

@imor I believe the tests should be passing now

@andrew-lee-architect
Copy link
Author

@imor @iambriccardo thanks for running the CI--any chance I can get a review/approval on this PR?

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.

4 participants