]> granicus.if.org Git - postgresql/commit
Don't send protocol messages to a shm_mq that no longer exists.
authorRobert Haas <rhaas@postgresql.org>
Fri, 16 Oct 2015 13:42:33 +0000 (09:42 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 16 Oct 2015 13:49:08 +0000 (09:49 -0400)
commit26981d292758c6ee9185332e4abc990ff19c81a2
treea3c650b277ace15358b25c15da181e465f242b6d
parenta93b3782e3358cbb1ad8d65386a2e1478b805649
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/backend/access/transam/parallel.c
src/backend/libpq/pqmq.c
src/backend/storage/ipc/shm_mq.c
src/include/libpq/pqmq.h
src/include/storage/shm_mq.h