Re: [HACKERS] Query cancel and OOB data

Поиск
Список
Период
Сортировка
От dg@illustra.com (David Gould)
Тема Re: [HACKERS] Query cancel and OOB data
Дата
Msg-id 9805181759.AA03520@hawk.illustra.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Query cancel and OOB data  (Bruce Momjian <maillist@candle.pha.pa.us>)
Ответы Re: [HACKERS] Query cancel and OOB data  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список 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?

Use TCP. On most modern systems (eg Linux ;-) ), TCP especially on the local
machine is very efficient. Not quite as efficient as a Unix domain socket,
but close enough that no one will notice.

To investigate this, see Larry McVoy's wonderful lmbench suite...

-dg

David Gould            dg@illustra.com           510.628.3783 or 510.305.9468
Informix Software  (No, really)         300 Lakeside Drive  Oakland, CA 94612
"Of course, someone who knows more about this will correct me if I'm wrong,
 and someone who knows less will correct me if I'm right."
               --David Palmer (palmer@tybalt.caltech.edu)

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Query cancel and OOB data
Следующее
От: "Matthew N. Dodd"
Дата:
Сообщение: Kerberos 5 breakage.