authentication_timeout ineffective for replication connections

Started by Andres Freundover 11 years ago2 messageshackers
Jump to latest
#1Andres Freund
andres@anarazel.de

Hi,

I just noticed that authentication_timeout is ineffective for
replication=true type connections. That's because walsender doesn't
register a SIGINT handler and authentication_timeout relies on having
one.

There's no problem with reading the initial startup packet
(ProcessStartupPacket/BackendInitialize) because we use a separate
handler there. But once that's done, before finishing authentication,
WalSndSignals() will have set SIGINT's handler to SIG_IGN.

Demo python program attached. You'll only see the problem if the
authentication method requires a password/addititional packets.

I think we could fix this by simply mapping SIGINT to die() instead
SIG_IGN.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

pgconn.pytext/plain; charset=us-asciiDownload
#2Bruce Momjian
bruce@momjian.us
In reply to: Andres Freund (#1)
Re: authentication_timeout ineffective for replication connections

On Tue, Jan 13, 2015 at 03:29:04PM +0100, Andres Freund wrote:

Hi,

I just noticed that authentication_timeout is ineffective for
replication=true type connections. That's because walsender doesn't
register a SIGINT handler and authentication_timeout relies on having
one.

There's no problem with reading the initial startup packet
(ProcessStartupPacket/BackendInitialize) because we use a separate
handler there. But once that's done, before finishing authentication,
WalSndSignals() will have set SIGINT's handler to SIG_IGN.

Demo python program attached. You'll only see the problem if the
authentication method requires a password/addititional packets.

I think we could fix this by simply mapping SIGINT to die() instead
SIG_IGN.

What is the status on this?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

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