Re: TODO-item: Add sleep() function, remove from regress.c - Mailing list pgsql-patches

From Tom Lane
Subject Re: TODO-item: Add sleep() function, remove from regress.c
Date
Msg-id 29474.1136905106@sss.pgh.pa.us
Whole thread Raw
In response to Re: TODO-item: Add sleep() function, remove from regress.c  (Joachim Wieland <joe@mcknight.de>)
List pgsql-patches
Joachim Wieland <joe@mcknight.de> writes:
> On Mon, Jan 09, 2006 at 08:50:36PM -0500, Tom Lane wrote:
>> The proposed regression test seems unacceptably fragile, as well as
>> rather pointless.

> Why is it fragile?

As your own comment pointed out, the test would "fail" on a heavily
loaded system, due to sleeping too long.  I do not see the need for
such a test anyway --- the stats regression test will exercise the
code sufficiently.

>> BTW, a serious problem with just passing it off to pg_usleep like that
>> is that the sleep can't be aborted by a cancel request

> No, cancelling the sleep works (at least for Unix). Isn't cancelling
> implemented via a signal that interrupts select() ?

On some systems the signal will interrupt select.  On some, not.
Note the coding in bgwriter.c's main loop for instance.

            regards, tom lane

pgsql-patches by date:

Previous
From: Joachim Wieland
Date:
Subject: Re: TODO-item: Add sleep() function, remove from regress.c
Next
From: Neil Conway
Date:
Subject: TupleDesc refcounting