Re: 7.4.2 Regression tests: test stats loops indefinately...

From: Vikram Kulkarni <vkulkarn(at)brownforces(dot)org>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: Vikram Kulkarni <vkulkarn(at)brownforces(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: 7.4.2 Regression tests: test stats loops indefinately...
Date: 2004-05-04 00:47:31
Message-ID: 20040504004730.GD30567@padu.brownforces.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, May 03, 2004 at 11:54:54PM +0200, Manfred Koizar wrote:
> On Mon, 3 May 2004 14:17:11 -0400, Vikram Kulkarni
> <vkulkarn(at)brownforces(dot)org> wrote:
> >the end of results/stats.out is:
> >-- let stats collector catch up
> >SELECT sleep('0:0:2'::interval);
> >
> >everything up till and including that matches expected/stats.out... but
> >the test simply stalls there. Unless I manuall kill the process, the
> >postmaster simply keeps soaking up CPU time indefinately.
>
> Please try this interactively in a psql session:
>
> CREATE FUNCTION sleep(interval) RETURNS integer AS '
> DECLARE
> endtime timestamp;
> BEGIN
> endtime := timeofday()::timestamp + $1;
> WHILE timeofday()::timestamp < endtime LOOP
> END LOOP;
> RETURN 0;
> END;
> ' LANGUAGE 'plpgsql';
>
> SELECT timeofday();
> SELECT timeofday()::timestamp;
> -- wait a few seconds ...
> SELECT timeofday()::timestamp;
> SELECT timeofday()::timestamp + '0:0:2'::interval;
>
> SELECT sleep('0:0:2'::interval);
>
> ... and tell us what happens.

$ createlang plpgsql test
$ psql test
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

test=# CREATE FUNCTION sleep(interval) RETURNS integer AS '
test'# DECLARE
test'# endtime timestamp;
test'# BEGIN
test'# endtime := timeofday()::timestamp + $1;
test'# WHILE timeofday()::timestamp < endtime LOOP
test'# END LOOP;
test'# RETURN 0;
test'# END;
test'# ' LANGUAGE 'plpgsql';
CREATE FUNCTION
test=# SELECT timeofday();
timeofday
-------------------------------------
Wed Dec 31 16:00:00.591964 1969 PST
(1 row)

test=# SELECT timeofday()::timestamp;
timeofday
----------------------------
1969-12-31 16:00:00.619152
(1 row)

test=# SELECT timeofday()::timestamp;
timeofday
----------------------------
1969-12-31 16:00:00.814891
(1 row)

test=# SELECT timeofday()::timestamp + '0:0:2'::interval;
?column?
----------------------------
1969-12-31 16:00:02.830715
(1 row)

test=# SELECT sleep('0:0:2'::interval);

And it just sits there indefinately...

That obviously doesn't look right. Isnt' timeofday() supposed to return
the current time of day? The system clock is set correctly.

the log file doesn't show anything interesting, except for me eventually
killing the postmaster process... :-\

The config.log is available at:
http://www.brownforces.org/config.log
(I figure that might be interesting...)

-Vik

--
vikram vinayak kulkarni "If you want pasta sauce, you
vkulkarn(at)brownforces(dot)org must have have pasta."
http://vvk.brownforces.org -Daniel Sachs

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message muteki 2004-05-04 04:08:34 wait_seconds in pg_ctl
Previous Message Alvaro Herrera 2004-05-03 23:01:02 Re: insert through function only