Re: BUG #14432: sslmode=allow causing authentication to time out

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nunziotocci2000(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14432: sslmode=allow causing authentication to time out
Date: 2016-11-24 20:52:25
Message-ID: 23234.1480020745@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

nunziotocci2000(at)gmail(dot)com writes:
> I send 100 login requests to PostgreSQL, and 2-3 of them come back 2 minutes
> later saying "server closed the connection unexpectedly", and the server
> logs say "canceling authentication due to timeout".

FWIW, I couldn't reproduce this (using RHEL6, don't have a Fedora
installation at the moment).

> I tracked it down to sslmode=allow. The below script reproduces the
> problem.

Since you haven't done anything to enable SSL in your test server,
sslmode=allow shouldn't have any effect except to allow libpq to
retry a failed connection attempt one time. libpq is pretty
simple-minded about that and will retry no matter what the specific
error report is, in particular it would do so for "too many clients".
So basically this ought to just increase the number of "too many clients"
failures you get. I wonder whether you are running into kernel
resource limits like number of processes or number of open files.
I was able to get some "fork failed: Resource temporarily unavailable"
type errors if I pushed max_connections high enough, but no unexpected
behavior.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2016-11-25 02:23:14 Re: Index file got removed
Previous Message Tom Lane 2016-11-24 19:15:08 Re: Index file got removed