@@ -129,15 +129,15 @@ static char const* const messageText[] =
129
129
130
130
static BackgroundWorker MtmSender = {
131
131
"mtm-sender" ,
132
- BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION , /* do not need connection to the database */
132
+ BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION ,
133
133
BgWorkerStart_ConsistentState ,
134
134
MULTIMASTER_BGW_RESTART_TIMEOUT ,
135
135
MtmTransSender
136
136
};
137
137
138
138
static BackgroundWorker MtmRecevier = {
139
139
"mtm-receiver" ,
140
- BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION , /* do not need connection to the database */
140
+ BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION ,
141
141
BgWorkerStart_ConsistentState ,
142
142
MULTIMASTER_BGW_RESTART_TIMEOUT ,
143
143
MtmTransReceiver
@@ -337,9 +337,11 @@ static void MtmCheckResponse(MtmArbiterMessage* resp)
337
337
static void MtmScheduleHeartbeat ()
338
338
{
339
339
// Assert(!last_sent_heartbeat || last_sent_heartbeat + MSEC_TO_USEC(MtmHeartbeatRecvTimeout) >= MtmGetSystemTime());
340
- enable_timeout_after (heartbeat_timer , MtmHeartbeatSendTimeout );
341
- send_heartbeat = true;
342
- PGSemaphoreUnlock (& Mtm -> votingSemaphore );
340
+ if (!stop ) {
341
+ enable_timeout_after (heartbeat_timer , MtmHeartbeatSendTimeout );
342
+ send_heartbeat = true;
343
+ PGSemaphoreUnlock (& Mtm -> votingSemaphore );
344
+ }
343
345
}
344
346
345
347
static void MtmSendHeartbeat ()
0 commit comments