Is psSocketPoll doing the right thing? - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Is psSocketPoll doing the right thing?
Date
Msg-id 20230209.115009.2229702014236187289.horikyota.ntt@gmail.com
Whole thread Raw
Responses Re: Is psSocketPoll doing the right thing?
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fix GUC_NO_SHOW_ALL test scenario in 003_check_guc.pl
Next
From: Andres Freund
Date:
Subject: Re: tests against running server occasionally fail, postgres_fdw & tenk1