Compare commits

...

2 Commits

Author SHA1 Message Date
Konstantin Knizhnik
38e184dd5c Move WaitEventSetWait after PQgetCopyData 2025-03-24 13:17:21 +02:00
Konstantin Knizhnik
83eb3e0ec9 Always do wait in pageserver_try_receive loop 2025-03-24 10:22:43 +02:00

View File

@@ -1152,7 +1152,8 @@ pageserver_try_receive(shardno_t shard_no)
while (true) while (true)
{ {
if (PQisBusy(shard->conn)) rc = PQgetCopyData(shard->conn, &resp_buff.data, 1 /* async */);
if (rc == 0)
{ {
WaitEvent event; WaitEvent event;
if (WaitEventSetWait(shard->wes_read, 0, &event, 1, if (WaitEventSetWait(shard->wes_read, 0, &event, 1,
@@ -1161,10 +1162,6 @@ pageserver_try_receive(shardno_t shard_no)
{ {
return NULL; return NULL;
} }
}
rc = PQgetCopyData(shard->conn, &resp_buff.data, 1 /* async */);
if (rc == 0)
{
if (!PQconsumeInput(shard->conn)) if (!PQconsumeInput(shard->conn))
{ {
return NULL; return NULL;