Skip to content

Commit a8af856

Browse files
author
Etsuro Fujita
committed
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
1 parent 82ed774 commit a8af856

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/executor/nodeAppend.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ ExecAppendAsyncEventWait(AppendState *node)
10011001
long timeout = node->as_syncdone ? -1 : 0;
10021002
WaitEvent occurred_event[EVENT_BUFFER_SIZE];
10031003
int noccurred;
1004+
int nevents;
10041005
int i;
10051006

10061007
/* We should never be called when there are no valid async subplans. */
@@ -1022,8 +1023,9 @@ ExecAppendAsyncEventWait(AppendState *node)
10221023
}
10231024

10241025
/* Wait for at least one event to occur. */
1026+
nevents = Min(node->as_nasyncplans + 1, EVENT_BUFFER_SIZE);
10251027
noccurred = WaitEventSetWait(node->as_eventset, timeout, occurred_event,
1026-
EVENT_BUFFER_SIZE, WAIT_EVENT_APPEND_READY);
1028+
nevents, WAIT_EVENT_APPEND_READY);
10271029
FreeWaitEventSet(node->as_eventset);
10281030
node->as_eventset = NULL;
10291031
if (noccurred == 0)

0 commit comments

Comments
 (0)