mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Adjust input value to WaitEventSetWait() in ExecAppendAsyncEventWait().
Adjust the number of events given to WaitEventSetWait() so that it doesn't exceed the maximum number of events in the WaitEventSet given to that function (set->nevents_space) in hopes of making the buildfarm green. Per valgrind failure report from Tom Lane and the buildfarm. Author: Etsuro Fujita Discussion: https://postgr.es/m/3411577.1617289776%40sss.pgh.pa.us
This commit is contained in:
@ -1001,6 +1001,7 @@ ExecAppendAsyncEventWait(AppendState *node)
|
|||||||
long timeout = node->as_syncdone ? -1 : 0;
|
long timeout = node->as_syncdone ? -1 : 0;
|
||||||
WaitEvent occurred_event[EVENT_BUFFER_SIZE];
|
WaitEvent occurred_event[EVENT_BUFFER_SIZE];
|
||||||
int noccurred;
|
int noccurred;
|
||||||
|
int nevents;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* We should never be called when there are no valid async subplans. */
|
/* We should never be called when there are no valid async subplans. */
|
||||||
@ -1022,8 +1023,9 @@ ExecAppendAsyncEventWait(AppendState *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for at least one event to occur. */
|
/* Wait for at least one event to occur. */
|
||||||
|
nevents = Min(node->as_nasyncplans + 1, EVENT_BUFFER_SIZE);
|
||||||
noccurred = WaitEventSetWait(node->as_eventset, timeout, occurred_event,
|
noccurred = WaitEventSetWait(node->as_eventset, timeout, occurred_event,
|
||||||
EVENT_BUFFER_SIZE, WAIT_EVENT_APPEND_READY);
|
nevents, WAIT_EVENT_APPEND_READY);
|
||||||
FreeWaitEventSet(node->as_eventset);
|
FreeWaitEventSet(node->as_eventset);
|
||||||
node->as_eventset = NULL;
|
node->as_eventset = NULL;
|
||||||
if (noccurred == 0)
|
if (noccurred == 0)
|
||||||
|
Reference in New Issue
Block a user