]> granicus.if.org Git - postgresql/commitdiff
Fix assertion failure for SSL connections.
authorThomas Munro <tmunro@postgresql.org>
Sun, 25 Nov 2018 03:21:41 +0000 (16:21 +1300)
committerThomas Munro <tmunro@postgresql.org>
Sun, 25 Nov 2018 05:34:58 +0000 (18:34 +1300)
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

src/backend/libpq/be-secure-openssl.c

index 2ca11c24099509f5fcb614d62cc1e7a683c286ab..6955d7230c708a6e1260b79f1a5fe63795c4bcf7 100644 (file)
@@ -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);