Re: Improve the granularity of PQsocketPoll's timeout parameter? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improve the granularity of PQsocketPoll's timeout parameter?
Date
Msg-id 928671.1718063844@sss.pgh.pa.us
Whole thread Raw
In response to Re: Improve the granularity of PQsocketPoll's timeout parameter?  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Improve the granularity of PQsocketPoll's timeout parameter?
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> I briefly skimmed the thread and didn't find the reason why the API
> requires an absolute time.

Because a common call pattern is to loop around PQsocketPoll calls.
In that scenario you generally want to nail down the timeout time
before starting the loop, not have it silently move forward after
any random event that breaks the current wait (EINTR for example).
pqSocketCheck and pqConnectDBComplete both rely on this.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Improve the granularity of PQsocketPoll's timeout parameter?
Next
From: Michael Paquier
Date:
Subject: Re: 001_rep_changes.pl fails due to publisher stuck on shutdown