jackc / jackc/pgx

Timeout if connection is lost (OpenVPN)

Open
#1,618 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

I am connected to a PostgreSQL server via OpenVPN.
I have an open connection that sends a select statement every 10 seconds in a loop.

If the OpenVPN connection closes due to some network issue, the next select statement takes 3min+ until a timeout appears.

Question:
Is there any elegant way of handling such a scenario and get an appropriate quick timeout response?
I have tested pgconn.checkConn(), but checkConn() tells, that everything is fine altough it isn't because OpenVPN connection has been gone.

Contributor guide

Open the contributing guide

Research direction

Start by examining pgconn.checkConn() and reproducing the reported loop against PostgreSQL while disconnecting OpenVPN. The issue does not identify a file, test, timeout setting, or expected implementation, so the appropriate quick-timeout behavior would need to be clarified before defining completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases, networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.