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 */
"stop because the subscription was removed",
MySubscription->name)));
- walrcv_disconnect(wrconn);
proc_exit(0);
}
"stop because the subscription was disabled",
MySubscription->name)));
- walrcv_disconnect(wrconn);
proc_exit(0);
}
"restart because the connection information was changed",
MySubscription->name)));
- walrcv_disconnect(wrconn);
proc_exit(0);
}
"restart because subscription was renamed",
MySubscription->name)));
- walrcv_disconnect(wrconn);
proc_exit(0);
}
"restart because the replication slot name was changed",
MySubscription->name)));
- walrcv_disconnect(wrconn);
proc_exit(0);
}
"restart because subscription's publications were changed",
MySubscription->name)));
- walrcv_disconnect(wrconn);
proc_exit(0);
}
/* Run the main loop. */
LogicalRepApplyLoop(origin_startpos);
- walrcv_disconnect(wrconn);
-
/* We should only get here if we received SIGTERM */
proc_exit(0);
}