Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single
Date
Msg-id 200804151738.m3FHcfx25866@momjian.us
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Alvaro Herrera wrote:
> >> I wonder if it's OK to grab an LWLock in a signal handler.
> 
> > I am not in a signal handler there --- pg_terminate_backend() happens
> > for the person requesting the termination, not the terminated backend
> > that gets the signal.
> 
> A more interesting question is what makes you think that taking
> ProcArrayLock here has any value whatsoever.

I took the lock so I would be sure the PGPROC array was the matching pid
and not some other pid that was created between my check and the setting
of the variable.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single
Next
From: "Merlin Moncure"
Date:
Subject: Re: pulling libpqtypes from queue