Joe Conway <mail@joeconway.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