View Single Post

   
  #1 (permalink)  
Old 04-18-2008, 12:55 AM
Tom Lane
 
Posts: n/a
Default Re: [BUGS] BUG #2569: statement_timeout bug on Windows

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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote