Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit454aab4

Browse files
committed
postgres_fdw: Fix bug in connection status check.
The buildfarm member "hake" reported a failure in the regression testadded by commit857df3c, where postgres_fdw_get_connections(true)returned unexpected results.The function postgres_fdw_get_connections(true) checksif a connection is closed by using POLLRDHUP in the requested eventsand calling poll(). Previously, the function only consideredPOLLRDHUP or 0 as valid returned events. However, poll() can alsoreturn POLLHUP, POLLERR, and/or POLLNVAL. So if any of these eventswere returned, postgres_fdw_get_connections(true) would reportincorrect results. postgres_fdw_get_connections(true) failed toaccount for these return events.This commit updates postgres_fdw_get_connections(true) to correctlyreport a closed connection when poll() returns not only POLLRDHUPbut also POLLHUP, POLLERR, or POLLNVAL.Discussion:https://postgr.es/m/fd8f6186-9e1e-4b9a-92c5-e71e3697d381@oss.nttdata.com
1 parent4b56bb4 commit454aab4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎contrib/postgres_fdw/connection.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,8 @@ pgfdw_conn_check(PGconn *conn)
23092309
if (result<0)
23102310
return-1;
23112311

2312-
return (input_fd.revents&POLLRDHUP) ?1 :0;
2312+
return (input_fd.revents&
2313+
(POLLRDHUP |POLLHUP |POLLERR |POLLNVAL)) ?1 :0;
23132314
}
23142315
#else
23152316
return0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp