Re: pg_terminate_backend for same-role - Mailing list pgsql-hackers

From Daniel Farina
Subject Re: pg_terminate_backend for same-role
Date
Msg-id CAAZKuFbUxCNxyLThu8EjRVwf+yTnQbuNF_zZyTK2Jx5JHYYcLA@mail.gmail.com
Whole thread Raw
In response to Re: pg_terminate_backend for same-role  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: pg_terminate_backend for same-role  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Mar 15, 2012 at 9:39 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> Shall we just do everything using the
>> MyCancelKey (which I think could just be called "SessionKey",
>> "SessionSecret", or even just "Session") as to ensure we have no case
>> of mistaken identity? Or does that end up being problematic?
>
> What if pid is unfortunately reused after passing the test of MyCancelKey
> and before sending the signal?

The way MyCancelKey is checked now is backwards, in my mind.  It seems
like it would be better checked by the receiving PID (one can use a
check/recheck also, if so inclined).  Is there a large caveat to that?
I'm working on a small patch to do this I hope to post soon (modulus
difficulties), but am fully aware that messing around PGPROC and
signal handling can be a bit fiddly.

-- 
fdr


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: pg_terminate_backend for same-role
Next
From: Tom Lane
Date:
Subject: Re: pg_terminate_backend for same-role