{
Assert(generation <= pg_atomic_read_u64(&ProcSignal->psh_barrierGeneration));
+ elog(DEBUG1,
+ "waiting for all backends to process ProcSignalBarrier generation "
+ UINT64_FORMAT,
+ generation);
+
for (int i = NumProcSignalSlots - 1; i >= 0; i--)
{
ProcSignalSlot *slot = &ProcSignal->psh_slot[i];
oldval = pg_atomic_read_u64(&slot->pss_barrierGeneration);
while (oldval < generation)
{
- ConditionVariableSleep(&slot->pss_barrierCV,
- WAIT_EVENT_PROC_SIGNAL_BARRIER);
+ if (ConditionVariableTimedSleep(&slot->pss_barrierCV,
+ 5000,
+ WAIT_EVENT_PROC_SIGNAL_BARRIER))
+ ereport(LOG,
+ (errmsg("still waiting for backend with PID %lu to accept ProcSignalBarrier",
+ (unsigned long) slot->pss_pid)));
oldval = pg_atomic_read_u64(&slot->pss_barrierGeneration);
}
ConditionVariableCancelSleep();
}
+ elog(DEBUG1,
+ "finished waiting for all backends to process ProcSignalBarrier generation "
+ UINT64_FORMAT,
+ generation);
+
/*
* The caller is probably calling this function because it wants to read
* the shared state or perform further writes to shared state once all