Re: Improve the granularity of PQsocketPoll's timeout parameter?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Tristan Partin <tristan(at)partin(dot)io>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dominique Devienne <ddevienne(at)gmail(dot)com>
Subject: Re: Improve the granularity of PQsocketPoll's timeout parameter?
Date: 2024-06-10 23:57:24
Message-ID: 928671.1718063844@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis <pgsql(at)j-davis(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-06-11 00:27:20 Re: 001_rep_changes.pl fails due to publisher stuck on shutdown
Previous Message Jeff Davis 2024-06-10 23:47:28 Re: Improve the granularity of PQsocketPoll's timeout parameter?