Is psSocketPoll doing the right thing?

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Is psSocketPoll doing the right thing?
Date: 2023-02-09 02:50:09
Message-ID: 20230209.115009.2229702014236187289.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

While looking a patch, I found that pqSocketPoll passes through the
result from poll(2) to the caller and throws away revents. If I
understand it correctly, poll() *doesn't* return -1 nor errno by the
reason it has set POLLERR, POLLHUP, POLLNVAL, and POLLRDHUP for some
of the target sockets, and returns 0 unless poll() itself failed to
work.

It doesn't seem to be the intended behavior since the function sets
POLLERR to pollfd.events. (but the bit is ignored by poll(), though)

Is the above diagnosis correct?

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-02-09 03:18:05 Re: tests against running server occasionally fail, postgres_fdw & tenk1
Previous Message Tom Lane 2023-02-09 02:42:13 Re: Fix GUC_NO_SHOW_ALL test scenario in 003_check_guc.pl