Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add database keepalive pings. #14

Merged
merged 1 commit into from
Jan 26, 2021
Merged

Conversation

cuevaskoch
Copy link
Contributor

Some microservice infrastructure configurations (notably, our usage of istio on
kubernetes) will detect long-running idle connections and kill them. This
causes an issue with the connection pooling implemented by some sql.DB drivers
that will assume that once a connection is open it will remain open
indefinitely.

This commit adds the SendKeepalivePings func to our database package so that we
can periodically send lightweight database queries and prevent the connection
from getting killed.

(+semver: feature)

Signed-off-by: Jeff Cuevas-Koch jeff@cuevaskoch.com

Some microservice infrastructure configurations (notably, our usage of istio on
kubernetes) will detect long-running idle connections and kill them.  This
causes an issue with the connection pooling implemented by some sql.DB drivers
that will assume that once a connection is open it will remain open
indefinitely.

This commit adds the SendKeepalivePings func to our database package so that we
can periodically send lightweight database queries and prevent the connection
from getting killed.

(+semver: feature)

Signed-off-by: Jeff Cuevas-Koch <jeff@cuevaskoch.com>
Copy link
Contributor

@dkaminski dkaminski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@cuevaskoch cuevaskoch merged commit 1bb6a8f into master Jan 26, 2021
@cuevaskoch cuevaskoch deleted the feature/EN-6865-broken-pipe branch January 26, 2021 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants