Re: BUG #14432: sslmode=allow causing authentication to time out - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #14432: sslmode=allow causing authentication to time out
Date
Msg-id 23234.1480020745@sss.pgh.pa.us
Whole thread Raw
In response to BUG #14432: sslmode=allow causing authentication to time out  (nunziotocci2000@gmail.com)
List pgsql-bugs
nunziotocci2000@gmail.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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Index file got removed
Next
From: Michael Paquier
Date:
Subject: Re: Index file got removed