Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a2ea334

Browse files
knizhnikkelvich
authored andcommitted
Insert CHECK_FOR_INTERRUPTS in sleep
1 parent 93b7e67 commit a2ea334

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

multimaster.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ void MtmSleep(timestamp_t interval)
342342

343343
while (nanosleep(&ts, &rem) < 0) {
344344
Assert(errno == EINTR);
345+
CHECK_FOR_INTERRUPTS();
345346
ts = rem;
346347
}
347348
}

pglogical_receiver.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,9 @@ void MtmStartReceiver(int nodeId, bool dynamic)
714714
worker.bgw_main_arg = Int32GetDatum(nodeId);
715715
if (dynamic) {
716716
BackgroundWorkerHandle *handle;
717-
RegisterDynamicBackgroundWorker(&worker, &handle);
717+
if (!RegisterDynamicBackgroundWorker(&worker, &handle)) {
718+
elog(WARNING, "Failed to start background worker, please increase max_worker_processes configuration parameter (current value is %d)", max_worker_processes);
719+
}
718720
} else {
719721
RegisterBackgroundWorker(&worker);
720722
}

0 commit comments

Comments
 (0)