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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Denis A Ustimenko <denis(at)oldham(dot)ru>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
Date: 2002-10-16 02:41:39
Message-ID: 20301.1034736099@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> [ some convincing test cases that timeout=1 is not good ]

> remains.tv_sec = atoi(conn->connect_timeout);
> + if (remains.tv_sec == 1)
> + remains.tv_sec += 1;
> if (!remains.tv_sec)
> {
> conn->status = CONNECTION_BAD;

On pure-paranoia grounds, I'd suggest the logic

+ /* force a sane minimum delay */
+ if (remains.tv_sec < 2)
+ remains.tv_sec = 2;

whereupon you could remove the failure check just below.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-16 02:54:45 Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
Previous Message Greg Copeland 2002-10-16 01:34:01 Re: Vacuum improvement