]> granicus.if.org Git - postgresql/commitdiff
Wire up query cancel interrupt for walsender backends.
authorAndres Freund <andres@anarazel.de>
Tue, 6 Jun 2017 01:53:41 +0000 (18:53 -0700)
committerAndres Freund <andres@anarazel.de>
Tue, 6 Jun 2017 02:18:16 +0000 (19:18 -0700)
This allows to cancel commands run over replication connections. While
it might have some use before v10, it has become important now that
normal SQL commands are allowed in database connected walsender
connections.

Author: Petr Jelinek
Reviewed-By: Andres Freund, Michael Paquier
Discussion: https://postgr.es/m/7966f454-7cd7-2b0c-8b70-cdca9d5a8c97@2ndquadrant.com

src/backend/replication/walsender.c

index 61d0a199d69c1575c52213eb94f1e8b91c0e9e34..976a42f86d395e3a79a3f4dffa8e99b2ffdc127b 100644 (file)
@@ -2929,7 +2929,7 @@ WalSndSignals(void)
        /* Set up signal handlers */
        pqsignal(SIGHUP, PostgresSigHupHandler);        /* set flag to read config
                                                                                                 * file */
-       pqsignal(SIGINT, SIG_IGN);      /* not used */
+       pqsignal(SIGINT, StatementCancelHandler);       /* query cancel */
        pqsignal(SIGTERM, die);         /* request shutdown */
        pqsignal(SIGQUIT, quickdie);    /* hard crash time */
        InitializeTimeouts();           /* establishes SIGALRM handler */