mirror of
https://github.com/postgres/postgres.git
synced 2025-12-06 00:02:13 +03:00
Reorganize logical replication worker disconnect code
Move the walrcv_disconnect() calls into the before_shmem_exit handler. This makes sure the call is always made even during exit by signal, it saves some duplicate code, and it makes the logic more similar to walreceiver.c. Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
This commit is contained in:
@@ -614,7 +614,13 @@ logicalrep_launcher_onexit(int code, Datum arg)
|
||||
static void
|
||||
logicalrep_worker_onexit(int code, Datum arg)
|
||||
{
|
||||
/* Disconnect gracefully from the remote side. */
|
||||
if (wrconn)
|
||||
walrcv_disconnect(wrconn);
|
||||
|
||||
logicalrep_worker_detach();
|
||||
|
||||
ApplyLauncherWakeup();
|
||||
}
|
||||
|
||||
/* SIGTERM: set flag to exit at next convenient time */
|
||||
|
||||
Reference in New Issue
Block a user