BUG #14708: Frequent connection timeout issue while connecting to Postgres database

Started by Nonameover 9 years ago2 messagesbugs
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t67704
psql -h localhost -U postgres

Built from patchset v2 (message #2), July 28, 2026 at 06:16 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t67704_2 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t67704_2 && git checkout t67704_2

Patchset v2 (message #2) is on t67704_2

Jump to latest
#1Noname
ruchitat@planittesting.com

The following bug has been logged on the website:

Bug reference: 14708
Logged by: Ruchita Terse
Email address: ruchitat@planittesting.com
PostgreSQL version: 9.6.1
Operating system: Windows
Description:

In our database setup we are often encounter wiht the connection timeout
issue while connecting with external application. Please find the detailed
information below.

While server trying to connect Postgres database we are getting following
error message :
1. FATAL: cancelling authentication due to timeout.
2. FATAL : two many clients already.

Even the number of actual connected clients is very minimum. The
maximum limit set for connection of clients is 200 and also currently
utilized connections are not more than 50 i.e not exceeding default
connection limit.

PS: We are connecting with port 5432

Kindly help us to resolve this issue.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Michael Paquier
michael@paquier.xyz
In reply to: Noname (#1)
Re: BUG #14708: Frequent connection timeout issue while connecting to Postgres database

On Thu, Jun 15, 2017 at 8:14 PM, <ruchitat@planittesting.com> wrote:

While server trying to connect Postgres database we are getting following
error message :
1. FATAL: cancelling authentication due to timeout.
2. FATAL : two many clients already.

Those are not error strings present in the source code. Those two are though:
"canceling authentication due to timeout"
"sorry, too many clients already"

Even the number of actual connected clients is very minimum. The
maximum limit set for connection of clients is 200 and also currently
utilized connections are not more than 50 i.e not exceeding default
connection limit.

Are you sure that there are not connection attempt spikes?
log_connections = on would help in checking incoming connection
attempts.

Kindly help us to resolve this issue.

I am not seeing any direct bugs here but...

The "due to timeout" message comes from ProcessInterrupts(), which
refers to the fact that the process is being shut down. So shouldn't
this message be changed? The current message looks confusing to me.
Please see the attached.
--
Michael

Attachments:

t67704_2
auth-cancel-log.patchtext/x-patch; charset=US-ASCII; name=auth-cancel-log.patchDownload+1-1