Re: elog(FATAL) vs shared memory

Поиск
Список
Период
Сортировка
От Stuart Bishop
Тема Re: elog(FATAL) vs shared memory
Дата
Msg-id 4614CE0D.7050405@canonical.com
обсуждение исходный текст
Ответ на Re: elog(FATAL) vs shared memory  (Mark Shuttleworth <mark@ubuntu.com>)
Ответы Re: elog(FATAL) vs shared memory  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: elog(FATAL) vs shared memory  (Jim Nasby <decibel@decibel.org>)
Список pgsql-hackers
Mark Shuttleworth wrote:
> Tom Lane wrote:
>> (1) something (still not sure what --- Martin and Mark, I'd really like
>> to know) was issuing random SIGTERMs to various postgres processes
>> including autovacuum.
>>
>
> This may be a misfeature in our test harness - I'll ask Stuart Bishop to
> comment.

After a test is run, the test harness kills any outstanding connections so
we can drop the test database. Without this, a failing test could leave open
connections dangling causing the drop database to block.

CREATE OR REPLACE FUNCTION _killall_backends(text)
RETURNS Boolean AS $$   import os   from signal import SIGTERM
   plan = plpy.prepare(       "SELECT procpid FROM pg_stat_activity WHERE datname=$1", ['text']       )   success =
True  for row in plpy.execute(plan, args):       try:           plpy.info("Killing %d" % row['procpid'])
os.kill(row['procpid'],SIGTERM)       except OSError:           success = False 
   return success
$$ LANGUAGE plpythonu;

--
Stuart Bishop <stuart.bishop@canonical.com>   http://www.canonical.com/
Canonical Ltd.                                http://www.ubuntu.com/


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

Предыдущее
От: Mark Shuttleworth
Дата:
Сообщение: Re: elog(FATAL) vs shared memory
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Auto Partitioning