Re: Keepalive

Поиск
Список
Период
Сортировка
От Rui DeSousa
Тема Re: Keepalive
Дата
Msg-id D52B3E92-EA77-4D2D-A39F-B21F65528208@icloud.com
обсуждение исходный текст
Ответ на Re: Keepalive  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Keepalive
Список pgsql-admin


On Jun 14, 2024, at 11:28 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Rui DeSousa <rui.desousa@icloud.com> writes:
I have a very long running query that is not being terminated after a keep alive timeout event.  The situation is that the client drops from the network, the servers’ tcp/ip stack drops the connection, and the Postgres query continues to run without a network connection.  

The given system is running on Linux and I’m being told this is expected behavior; however, that is not has not been my experience.  My preferred platform to run Postgres on is FreeBSD and in cases like this the Postgres session is also terminated once the tcp/ip connection is dropped by the kernel.

Really?

I would expect the query to keep running until the backend tries to
perform some I/O to the client.  How quickly that happens would depend
a great deal on the details of the query, but not on which OS you're
running on.

regards, tom lane


I just tried the following spinner() function on FreeBSD and the keep alive timeout event cause both the network connection to be torn down along with the Postgres session -- as I would expect it to do.  I will try this exact function on the Linux system and see if I get different results and report back; however, I might not be able to test it out until next week.


create or replace function spinner()
returns void
as $$
declare
 _x bigint := 0;
begin
   loop
     _x := _x + 1;
   end loop;
end;
$$ language plpgsql
;



В списке pgsql-admin по дате отправления:

Предыдущее
От: Chris Hoover
Дата:
Сообщение: Re: Outage caused by query in IPC:MessageQueueReceive wait????
Следующее
От: Rui DeSousa
Дата:
Сообщение: Re: Keepalive