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 28850.1155154238@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: [BUGS] BUG #2569: statement_timeout bug on Windows  (Bruce Momjian <bruce@momjian.us>)
List pgsql-patches
Bruce Momjian <bruce@momjian.us> writes:
!                 /* WaitForSingleObjectEx() uses milliseconds */
> !                 waittime = timerCommArea.value.it_value.tv_usec / 1000 + timerCommArea.value.it_value.tv_sec *
1000;

Seems like this probably ought to round up not down:

    waittime = (timerCommArea.value.it_value.tv_usec + 999) / 1000 + timerCommArea.value.it_value.tv_sec * 1000;

Otherwise, an attempt to wait for 100 usec would convert to waittime 0,
which seems like a bad thing.  In general the semantics of timed waits
are always supposed to be "you wait at least this long".

            regards, tom lane

pgsql-patches by date:

Previous
From: Greg Sabino Mullane
Date:
Subject: Fix statement timing display
Next
From: Tom Lane
Date:
Subject: Re: Maintaining cluster order on insert