Re: [PATCHES] BUG #2569: statement_timeout bug on Windows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, James <im-james(at)hotmail(dot)com>, pgsql-bugs(at)postgresql(dot)org, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [PATCHES] BUG #2569: statement_timeout bug on Windows
Date: 2006-08-09 20:50:44
Message-ID: 29255.1155156644@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-patches

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Tom Lane wrote:
>> Seems like this probably ought to round up not down:

> I thought about that, but because statement_timeout is in millis, and
> not micros, we can't have a value that gets rounded down. I am
> thinking a cleaner solution is to check for secs and if that is 0 and
> microsecs < 1000, you set millis = 1.

This is much uglier, probably slower, and fixes the problem only for
the zero case --- it is just as wrong to wait 1 msec when the caller
asked for 1.5 msec. And per your own observation, statement_timeout
is not the only source of the wait values, so this code must not
assume that the value is a multiple of 1msec.

Please do it the other way.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2006-08-09 21:18:22 Re: [HACKERS] [PATCHES] BUG #2569: statement_timeout bug on
Previous Message Bruce Momjian 2006-08-09 20:41:26 Re: [PATCHES] BUG #2569: statement_timeout bug on Windows

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2006-08-09 20:52:00 Re: 8.2 features status
Previous Message DEV 2006-08-09 20:47:34 Re: WIN32 Build?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-08-09 21:18:22 Re: [HACKERS] [PATCHES] BUG #2569: statement_timeout bug on
Previous Message Jonah H. Harris 2006-08-09 20:47:31 Re: Maintaining cluster order on insert