remove_socket_check
Onder Kalaci 2022-11-18 16:27:30 +01:00
parent 754d6e201e
commit 6e8605c27b
1 changed files with 15 additions and 10 deletions

View File

@ -2689,15 +2689,6 @@ RunDistributedExecution(DistributedExecution *execution)
} }
else if (execution->rebuildWaitEventSet) else if (execution->rebuildWaitEventSet)
{ {
if (execution->events != NULL)
{
/*
* The execution might take a while, so explicitly free at this point
* because we don't need anymore.
*/
pfree(execution->events);
execution->events = NULL;
}
eventSetSize = RebuildWaitEventSet(execution, false); eventSetSize = RebuildWaitEventSet(execution, false);
skipWaitEvents = skipWaitEvents =
@ -2844,6 +2835,16 @@ HasIncompleteConnectionEstablishment(DistributedExecution *execution)
static int static int
RebuildWaitEventSet(DistributedExecution *execution, bool socketClosedOnly) RebuildWaitEventSet(DistributedExecution *execution, bool socketClosedOnly)
{ {
if (execution->events != NULL)
{
/*
* The execution might take a while, so explicitly free at this point
* because we don't need anymore.
*/
pfree(execution->events);
execution->events = NULL;
}
if (execution->waitEventSet != NULL) if (execution->waitEventSet != NULL)
{ {
FreeWaitEventSet(execution->waitEventSet); FreeWaitEventSet(execution->waitEventSet);
@ -3413,7 +3414,11 @@ OpenNewConnections(WorkerPool *workerPool, int newConnectionCount,
long timeout = 0;/* don't wait */ long timeout = 0;/* don't wait */
int eventCount = WaitEventSetWait(workerPool->distributedExecution->waitEventSet, timeout, workerPool->distributedExecution->events, size, WAIT_EVENT_CLIENT_READ); int eventCount =
WaitEventSetWait(workerPool->distributedExecution->waitEventSet,
timeout, workerPool->distributedExecution->events,
size, WAIT_EVENT_CLIENT_READ);
ProcessWaitEventsForSocketClosed(workerPool->distributedExecution->events, eventCount); ProcessWaitEventsForSocketClosed(workerPool->distributedExecution->events, eventCount);
workerPool->distributedExecution->waitFlagsChanged = true; workerPool->distributedExecution->waitFlagsChanged = true;