Re: connect_timeout parameter in libpq - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: connect_timeout parameter in libpq
Date
Msg-id 200208150355.g7F3tOf22678@candle.pha.pa.us
Whole thread Raw
In response to Re: connect_timeout parameter in libpq  (Denis A Ustimenko <denis@oldham.ru>)
List pgsql-patches
Uh, I wait a day or two to see if anyone comments, then I add it to the
patch queue. I will do that now.

---------------------------------------------------------------------------

Denis A Ustimenko wrote:
> Hi, there!
>
> I have posted patch two days ago. It has accurate timeout
> calculation, use gettimeofday(), includes documentation and so on
> accordind Tom's demand. Unfortunately I have recieved no comments.
> Why?
>
> Regards
> Denis
>
> On Mon, 12 Aug 2002, Tom Lane wrote:
>
> > Denis A Ustimenko <denis@oldham.ru> writes:
> > > I need to change current connectDBComplete() behavior ( hang if
> > > backend are not responding). Here is the patch. Please apply.
> >
> > Shouldn't such a patch include documentation updates?  (And not
> > only user-level documentation; this patch adds not even a single
> > comment to explain what it's doing or why.)
> >
> > I'm also not thrilled with the way that the patch imposes the
> > overhead of calculating the timeout whether the user wants it or not.
> > The time() kernel calls should be skipped unless needed.
> >
> > A final comment is that the patch's timeout accuracy is quite poor, since
> > time()'s result is quantized to seconds.  gettimeofday() might be a
> > better choice.  Also it seems to assume that select() does not modify its
> > timeout argument, which is not a portable assumption.  On some platforms
> > the timeout struct is decremented by the elapsed time.
> >
> >             regards, tom lane
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Denis A Ustimenko
Date:
Subject: Re: connect_timeout parameter in libpq
Next
From: Bruce Momjian
Date:
Subject: Re: connect_timeout parameter in libpq