Re: Add client connection check during the execution of the query
Zhihong Yu <zyu@yugabyte.com>
From: Zhihong Yu <zyu@yugabyte.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>,
Maksim Milyutin <milyutinma@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>,
Tatsuo Ishii <ishii@sraoss.co.jp>, Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>
Date: 2021-10-08T03:57:39Z
Lists: pgsql-hackers
On Thu, Oct 7, 2021 at 8:43 PM Thomas Munro <thomas.munro@gmail.com> wrote: > On Sat, Jun 12, 2021 at 8:31 PM Zhihong Yu <zyu@yugabyte.com> wrote: > > +#ifdef POLLRDHUP > > + if ((cur_event->events & WL_SOCKET_CLOSED) && > > + (cur_pollfd->revents & (POLLRDHUP | errflags))) > > > > It seems the last condition above should be written as: > > > > ((cur_pollfd->revents & POLLRDHUP) | (cur_pollfd->revents & errflags)) > > Hi Zhihong, > > Why? Isn't (A & B) | (A & C) is the same as A & (B | C)? > Hi, My former comment was about 4 months old. The current way as expressed in the patch should be fine. Cheers
Commits
-
Add WL_SOCKET_CLOSED for socket shutdown events.
- 50e570a59e7f 15.0 landed
-
Use WL_SOCKET_CLOSED for client_connection_check_interval.
- cba5b994c990 15.0 landed
-
Detect POLLHUP/POLLRDHUP while running queries.
- c30f54ad732c 14.0 landed
-
Improve timeout.c's handling of repeated timeout set/cancel.
- 09cf1d522676 14.0 cited