Re: How to know killed by pg_terminate_backend - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: How to know killed by pg_terminate_backend
Date
Msg-id AANLkTimQKz57UWmJE=s=_M9w3E3YGb_i_h0KwSu-BMJV@mail.gmail.com
Whole thread Raw
In response to Re: How to know killed by pg_terminate_backend  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: How to know killed by pg_terminate_backend  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jan 21, 2011 at 13:56, Tatsuo Ishii <ishii@postgresql.org> wrote:
>> Here is the patch to implement the feature.
>>
>> 1) pg_terminate_backend() sends SIGUSR1 signal rather than SIGTERM to
>>    the target backend.
>> 2) The infrastructure used for message passing is
>>    storage/ipc/procsignal.c The new message type for ProcSignalReason
>>    is "PROCSIG_TERMNINATE_BACKEND_INTERRUPT"
>>  3) I assign new error code 57P04 which is returned from the backend
>>       killed by pg_terminate_backend().
>>
>> #define ERRCODE_TERMINATE_BACKEND                     MAKE_SQLSTATE('5','7', 'P','0','4')
>
> Anyone has better idea? Tom dislikes my patch but I don't know how to
> deal with it.

There was another design in the past discussion:
>> One idea is postmaster sets a flag in the shared memory area
>> indicating it rceived SIGTERM before forwarding the signal to
>> backends.

Is it enough for your purpose and do we think it is more robust way?

--
Itagaki Takahiro


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: SSI and Hot Standby
Next
From: Magnus Hagander
Date:
Subject: Re: Is there a way to build PostgreSQL client libraries with MinGW