Re: Cancel key now ready - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Cancel key now ready
Date
Msg-id 10662.897325043@sss.pgh.pa.us
Whole thread Raw
In response to Cancel key now ready  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Re: Cancel key now ready
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Now I need help in passing the value to the font-end, and having the
> front-end pass it to the backend for a cancel.

I can work on that.  Have you checked the postmaster changes into cvs?

> I do not recommend passing the pid because I will store the cancel key
> in the per-backend structure, so having the pid does not help me find
> the backend.  Might as well just scan the table to find the matching
> cancel key, and kill that backend.  We will have to store the pid in
> the structure, but that is easy to do.

I don't like this.  Backend PIDs are guaranteed unique (among active
backends); cancel keys are not guaranteed unique, unless you took some
special measure to make them so.  So you could hit the wrong backend
if you only compare cancel keys.  Since you must store the PID anyway to
send the signal, you may as well use both to verify that you have found
the right backend.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Cancel key now ready
Next
From: mark metzger
Date:
Subject: [HACKERS] Upgrade improvements.