remove_socket_check
Onder Kalaci 2022-11-18 16:58:23 +01:00
parent 11ff4a1faf
commit 1e5096e29d
1 changed files with 11 additions and 4 deletions

View File

@ -3326,10 +3326,10 @@ OpenNewConnections(WorkerPool *workerPool, int newConnectionCount,
newConnectionsList = lappend(newConnectionsList, session); newConnectionsList = lappend(newConnectionsList, session);
} }
#if PG_VERSION_NUM >= PG_VERSION_15
bool socketClosedOnly = true; bool socketClosedOnly = true;
RebuildWaitEventSet(workerPool->distributedExecution, socketClosedOnly); RebuildWaitEventSet(workerPool->distributedExecution, socketClosedOnly);
/* /*
* Before using this connection in the distributed execution, we check * Before using this connection in the distributed execution, we check
* whether the remote connection is closed/lost. This is common * whether the remote connection is closed/lost. This is common
@ -3344,7 +3344,6 @@ OpenNewConnections(WorkerPool *workerPool, int newConnectionCount,
workerPool->distributedExecution->eventSetSize, workerPool->distributedExecution->eventSetSize,
WAIT_EVENT_CLIENT_READ); WAIT_EVENT_CLIENT_READ);
#if PG_VERSION_NUM >= PG_VERSION_15
ProcessWaitEventsForSocketClosed(workerPool->distributedExecution->events, ProcessWaitEventsForSocketClosed(workerPool->distributedExecution->events,
eventCount); eventCount);
#endif #endif
@ -5490,8 +5489,10 @@ BuildWaitEventSet(List *sessionList, bool socketClosedOnly)
NULL); NULL);
if (!socketClosedOnly) if (!socketClosedOnly)
{
CitusAddWaitEventSetToSet(waitEventSet, WL_LATCH_SET, PGINVALID_SOCKET, MyLatch, CitusAddWaitEventSetToSet(waitEventSet, WL_LATCH_SET, PGINVALID_SOCKET, MyLatch,
NULL); NULL);
}
return waitEventSet; return waitEventSet;
} }
@ -5503,8 +5504,8 @@ BuildWaitEventSet(List *sessionList, bool socketClosedOnly)
* to the waitEventSet. * to the waitEventSet.
*/ */
static void static void
AddSessionToWaitEventSet(WorkerSession *session, WaitEventSet *waitEventSet, bool AddSessionToWaitEventSet(WorkerSession *session, WaitEventSet *waitEventSet,
socketClosedOnly) bool socketClosedOnly)
{ {
MultiConnection *connection = session->connection; MultiConnection *connection = session->connection;
@ -5531,9 +5532,15 @@ AddSessionToWaitEventSet(WorkerSession *session, WaitEventSet *waitEventSet, boo
if (socketClosedOnly) if (socketClosedOnly)
{ {
#if PG_VERSION_NUM >= PG_VERSION_15
waitEventSetIndex = CitusAddWaitEventSetToSet(waitEventSet, WL_SOCKET_CLOSED, waitEventSetIndex = CitusAddWaitEventSetToSet(waitEventSet, WL_SOCKET_CLOSED,
sock, sock,
NULL, (void *) session); NULL, (void *) session);
#else
/* socketClosedOnly is only true for */
Assert (false);
#endif
} }
else else
{ {