Re: idle_in_transaction_timeout

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Kevin Grittner <kgrittn(at)ymail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: idle_in_transaction_timeout
Date: 2014-06-29 23:51:05
Message-ID: 7666.1404085865@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> Note that we're *inside* recv() here.

Well, actually, the recv() has probably failed with an EINTR at this
point, or else it will when/if control returns.

>> Uh, no, that would pretty much destroy the point of trying to report
>> an error message at all.

> I only mean that we should do so in scenarios where we're currently
> reading from the client. For die(), while we're reading from the client,
> we're sending a message the client doesn't expect - and thus
> unsurprisingly doesn't report.

This is nonsense. The client will see the error as a response to its
query. Of course, if it gets an EPIPE it might complain about that first
-- but that would only be likely to happen with a multi-packet query
string, at least over a TCP connection.

Experimenting with this on a RHEL6 box, I do see the "FATAL: terminating
connection due to administrator command" message if I SIGTERM a backend
while idle and it's using a TCP connection; psql sees that as a response
next time it issues a command. I do get the EPIPE behavior over a
Unix-socket connection, but I wonder if we shouldn't try to fix that.
It would make sense to see if there's data available before complaining
about the EPIPE.

Don't currently have an SSL configuration to experiment with.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-06-29 23:52:23 Re: Deferring some AtStart* allocations?
Previous Message Andres Freund 2014-06-29 23:31:53 Re: idle_in_transaction_timeout