From 2ad5c27bb565c26a4b12ea3343331c80f121f269 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 16 Oct 2015 09:42:33 -0400 Subject: Don't send protocol messages to a shm_mq that no longer exists. Commit 2bd9e412f92bc6a68f3e8bcb18e04955cc35001d introduced a mechanism for relaying protocol messages from a background worker to another backend via a shm_mq. However, there was no provision for shutting down the communication channel. Therefore, a protocol message sent late in the shutdown sequence, such as a DEBUG message resulting from cranking up log_min_messages, could crash the server. To fix, install an on_dsm_detach callback that disables sending messages to the shm_mq when the associated DSM is detached. --- src/include/libpq/pqmq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include/libpq') diff --git a/src/include/libpq/pqmq.h b/src/include/libpq/pqmq.h index 901756596a4..97f17da89db 100644 --- a/src/include/libpq/pqmq.h +++ b/src/include/libpq/pqmq.h @@ -16,7 +16,7 @@ #include "lib/stringinfo.h" #include "storage/shm_mq.h" -extern void pq_redirect_to_shm_mq(shm_mq *, shm_mq_handle *); +extern void pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh); extern void pq_set_parallel_master(pid_t pid, BackendId backend_id); extern void pq_parse_errornotice(StringInfo str, ErrorData *edata); -- cgit v1.2.3