Re: pg_cancel_backend() does not work with buzz queries

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_cancel_backend() does not work with buzz queries
Date: 2007-10-03 10:18:32
Message-ID: 47036C78.2020306@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-ru-general

Don't forget to cc: the list.
Try not to top-post replies, it's easier to read if you reply below the
text you're replying to.

Sergey Konoplev wrote:
>> 1. Is it always the same query?
>> 2. Does the client still think it's connected?
>> 3. Is that query using up CPU, or just idling?
>> 4. Anything odd in pg_locks for the problem pid?

> 1. No it isn't. I have few functions (plpgsql, plpython) that cause
> such situations more often than another but they are called more often
> also.

OK, so there's no real pattern. That would suggest it's not a particular
query-plan that's got something wrong.

Do you always get this problem inside a function?

> 2. The client just waits for query and buzz.
> 3. They are using CPU in usual way and their pg_lock activity seems normal.

So the backend that appears "stuck" is still using CPU?

> 4. No I haven't noticed anything odd.

So - the symptoms are:
1. Client hangs, waiting for the result of a query
2. You notice this
3. You issue pg_cancel_backend() which sends a SIGINT which doesn't do
anything
4. You have to cancel the query from the command-line using "kill -9
<backend-pid>"

Are you happy that your hardware and drivers are OK? There aren't
problems with any other servers on this machine?

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Diego Gil 2007-10-03 10:26:17 Re: datestyle question
Previous Message Richard Huxton 2007-10-03 09:10:52 Re: pg_cancel_backend() does not work with buzz queries

Browse pgsql-ru-general by date

  From Date Subject
Next Message Sergey Konoplev 2007-10-03 10:51:14 Fwd: pg_cancel_backend() не снимает зависшие транзакции
Previous Message Заяц Алексей 2007-10-03 09:13:43 Re: pg_cancel_backend() не снимает зависшие транзакции