Always do wait in pageserver_try_receive loop

This commit is contained in:
Konstantin Knizhnik
2025-03-24 10:22:43 +02:00
parent 3e5884ff01
commit 83eb3e0ec9

View File

@@ -1152,15 +1152,12 @@ pageserver_try_receive(shardno_t shard_no)
while (true)
{
if (PQisBusy(shard->conn))
WaitEvent event;
if (WaitEventSetWait(shard->wes_read, 0, &event, 1,
WAIT_EVENT_NEON_PS_READ) != 1
|| (event.events & WL_SOCKET_READABLE) == 0)
{
WaitEvent event;
if (WaitEventSetWait(shard->wes_read, 0, &event, 1,
WAIT_EVENT_NEON_PS_READ) != 1
|| (event.events & WL_SOCKET_READABLE) == 0)
{
return NULL;
}
return NULL;
}
rc = PQgetCopyData(shard->conn, &resp_buff.data, 1 /* async */);
if (rc == 0)