-
Notifications
You must be signed in to change notification settings - Fork 916
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
write: connection reset by peer should close the connection #1028
Comments
Possibly a duplicate of #835. |
Thanks for linking issues! @Lekensteyn |
For some reason I am using an old version (1.7.0), unsure why goland resolved to that (most likely I already had it downloaded). I will try with a more recent version, thanks a LOT for that. |
I still have issue with the latest version, either |
@Sytten Did switching your database driver to /jackc/pgx resolve the 'connection reset by peer' issue? I look forward to your reply. Thank you very much. |
I dont remember, probably. I dont use golang anymore. |
Setup
I am using a serverless setup on GCP Cloud Run (knative) with a database in VPC accessed via a serverless connector.
This is a similar to a setup where a server communicates with a database behind an HAProxy or an NGINX.
The only difference is that if the server is not receiving requests, its CPU is heavily throttled.
Problem
I started receiving errors like:
Where
10.1.0.2
is the database, that tells me that most likely the connection to the proxy was maintained but the connection to the host was killed. I would expectpq
to be able to detect that, kill the connection and retry on a new one. But it seems it is not the case and the pool will happily continue using the connection even if it is effectively dead.This is patchable with a
SetConnMaxIdleTime
orSetConnMaxLifetime
, but I feel a network error like that should be able to detected and acted upon directly.The text was updated successfully, but these errors were encountered: