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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: TODO-item: Add sleep() function, remove from regress.c
Date: 2006-01-10 14:58:26
Message-ID: 29474.1136905106@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Joachim Wieland <joe(at)mcknight(dot)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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Dave Page 2006-01-10 20:51:49 Re: Question about Postgresql time fields(possible bug)
Previous Message Joachim Wieland 2006-01-10 10:31:13 Re: TODO-item: Add sleep() function, remove from regress.c