Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
Date
Msg-id 24412.1034780525@sss.pgh.pa.us
Whole thread Raw
In response to Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> Still, one could ask why we are expending extra cycles to make the
>> timeout more accurate.  Who the heck needs an accurate timeout on
>> connect?  Can you really give a use-case where the user won't have
>> picked a number out of the air anyway?

> I think we do need to properly compute the timeout on an EINTR of
> select() because if we don't, a 30 second timeout could become 90
> seconds if select() is interrupted.  The other time() calls are needed,
> one above the loop, and one inside the loop.

AFAICS we need one time() call at the start, and then one inside the
select loop.  I haven't looked at your recent patches, but you said
something about putting two calls in the loop; that seems like overkill.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
Next
From: Bruce Momjian
Date:
Subject: Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c