Re: Add client connection check during the execution of the query
От | Thomas Munro |
---|---|
Тема | Re: Add client connection check during the execution of the query |
Дата | |
Msg-id | CA+hUKGL9LLNE8_+rBkRzBhmXA1XHEzJVqQr4T4fqzngqp66=-g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Add client connection check during the execution of the query (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>) |
Ответы |
Re: Add client connection check during the execution of the query
Re: Add client connection check during the execution of the query |
Список | pgsql-hackers |
Going back a couple of years to something Konstantin said: On Sat, Aug 3, 2019 at 4:40 AM Konstantin Knizhnik <k.knizhnik@postgrespro.ru> wrote: > But I wonder why we can not perform just pool with POLLOUT flag and zero > timeout. > If OS detected closed connection, it should return POLLHUP, should not it? > I am not sure if it is more portable or more efficient way - just seems > to be a little bit more natural way (from my point of view) to check if > connection is still alive. ... Andres just asked me the same question, when we were discussing the pq_peekmessage() patch (v7). I had remembered that POLLHUP didn't work for this type of thing, from some earlier attempt at something similar, and indeed on my first attempt to do that here as an alternative design, it did not work... with TCP sockets (localhost)... though it did work with Unix sockets. Gah! Then he pointed me at POLLRDHUP (a Linux only extension) and that did seem to work in all cases I tried. But without that, this v8 patch doesn't seem to work on FreeBSD (TCP), and for the rest of the menagerie, who knows? Here's a sketch patch like that for discussion. It's frustrating, because this patch is so simple, and doesn't have v7's problem with pipelined queries. Hmm. (I tried to make it work on Windows too by reading the manual, no idea if that part compiles or works).
Вложения
В списке pgsql-hackers по дате отправления: