Re: [HACKERS] Query cancel and OOB data - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Query cancel and OOB data
Date
Msg-id 199805181735.NAA22092@candle.pha.pa.us
Whole thread Raw
Responses Re: [HACKERS] Query cancel and OOB data
Re: [HACKERS] Query cancel and OOB data
List pgsql-hackers
> Bruce Momjian wrote:
>
> > OK, thanks to Tom Lane's many patches, I have query cancel working on my
> > machine.  However, it is not working with Unix domain sockets.  I get:
> >
> >         Cannot send cancel request:
> >         PQrequestCancel() -- couldn't send OOB data: errno=45
> >         Operation not supported
> >
> > This is under BSDI 3.1.
> >
> > Do Unix Domain sockets support OOB(out-of-band) data?
> >
>
> Unix domain sockets don't support OOB (Stevens, Unix Network Programming).

Yea, I found that too, late last night, Section 6.14, page 332.

I basically need some way to 'signal' the backend of a cancellation
request.  Polling the socket is not an option because it would impose
too great a performance penalty.  Maybe async-io on a read(), but that
is not going to be very portable.

I could pass the backend pid to the front end, and send a kill(SIG_URG)
to that pid on a cancel, but the frontend can be running as a different
user than the backend.  Problem is, the only communcation channel is
that unix domain socket.

We basically need some way to get the attention of the backend,
hopefully via some signal.

Any ideas?

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Michal Mosiewicz
Date:
Subject: Re: [HACKERS] Re: [PATCHES] char/varchar locale support
Next
From: dg@illustra.com (David Gould)
Date:
Subject: Re: [HACKERS] Query cancel and OOB data