Re: [BUGS] BUG #2569: statement_timeout bug on Windows - Mailing list pgsql-patches

From Tom Lane
Subject Re: [BUGS] BUG #2569: statement_timeout bug on Windows
Date
Msg-id 29255.1155156644@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #2569: statement_timeout bug on Windows  (Bruce Momjian <bruce@momjian.us>)
Responses Re: [HACKERS] [BUGS] BUG #2569: statement_timeout bug on
List pgsql-patches
Bruce Momjian <bruce@momjian.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

pgsql-patches by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: Maintaining cluster order on insert
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] [BUGS] BUG #2569: statement_timeout bug on