aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2018-11-25 16:21:41 +1300
committerThomas Munro <tmunro@postgresql.org>2018-11-25 18:34:58 +1300
commitab69ea9feeb9a02c6299b5c1b786005552343f22 (patch)
tree5ee8cc19a00ee4d10a45cfac2798c1d499052079
parentd5890f49da6a77b1325a3f5822c6b092a2cd41ae (diff)
downloadpostgresql-ab69ea9feeb9a02c6299b5c1b786005552343f22.tar.gz
postgresql-ab69ea9feeb9a02c6299b5c1b786005552343f22.zip
Fix assertion failure for SSL connections.
Commit cfdf4dc4 added an assertion that every WaitLatch() or similar handles postmaster death. One place did not, but was missed in review and testing due to the need for an SSL connection. Fix, by asking for WL_EXIT_ON_PM_DEATH. Reported-by: Christoph Berg Discussion: https://postgr.es/m/20181124143845.GA15039%40msg.df7cb.de
-rw-r--r--src/backend/libpq/be-secure-openssl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index 2ca11c24099..6955d7230c7 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -406,9 +406,9 @@ aloop:
* StartupPacketTimeoutHandler() which directly exits.
*/
if (err == SSL_ERROR_WANT_READ)
- waitfor = WL_SOCKET_READABLE;
+ waitfor = WL_SOCKET_READABLE | WL_EXIT_ON_PM_DEATH;
else
- waitfor = WL_SOCKET_WRITEABLE;
+ waitfor = WL_SOCKET_WRITEABLE | WL_EXIT_ON_PM_DEATH;
(void) WaitLatchOrSocket(MyLatch, waitfor, port->sock, 0,
WAIT_EVENT_SSL_OPEN_SERVER);