Bug #929: Client connection to postgresql hangs indefinitely (under possibly pathological scenarios)

Lists: pgsql-bugs
From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #929: Client connection to postgresql hangs indefinitely (under possibly pathological scenarios)
Date: 2003-04-01 01:27:21
Message-ID: 20030401012721.0505E475D91@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Claudio Natoli (claudio(dot)natoli(at)memetrics(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Client connection to postgresql hangs indefinitely (under possibly pathological scenarios)

Long Description

Configuration
=============
WinNT 4.0.0 (build 1381 w/ SP6)
Cygwin 1.3.22-1 w/ cygipc-1.13-2
Postgres 7.3.2-1
[PostgreSQL 7.3.2 on i686-pc-cygwin, compiled by GCC gcc (GCC) 3.2 20020927 (prerelease)]

Note: Problem may be limited to Windows installation (cygipc?); have reproduced on "virgin" Win2K; have not been able to reproduce under Linux

Steps to reproduce
==================

With a running postmaster:

* (A) Connect to some existing database with psql (eg. psql -d test_me)
- leave this psql running

* (B) In another window, issue a command like the following:
psql -d test_me < test.sql > /tmp/out

where test.sql is a file composed of many, many thousands of the following pair of statements:
create table dud_table (f integer);
drop table dud_table;

Invariably, after some period of time, the second connection (B) will hang. Exiting (A) does not cause (B) to recover, although it does appear crucial to have a connection other than (B) open in order to exercise the bug. (B) will recover if the postmaster is shutdown.

Note: There are many variation on this theme, such as starting (A) whilst (B) is running.

FYI, encountered this when running unit-tests for our system (which connects to postgres via ODBC). One test, which drops and create a handful of tables along with various other database operations, occasionally hangs. Originally believed the problem to be in our system, then perhaps ODBC, before iterating to the minimalist example above.

Sample Code

No file was uploaded with this report


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: claudio(dot)natoli(at)memetrics(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #929: Client connection to postgresql hangs indefinitely (under possibly pathological scenarios)
Date: 2003-04-01 01:42:23
Message-ID: 26849.1049161343@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)org writes:
> where test.sql is a file composed of many, many thousands of the following pair of statements:
> create table dud_table (f integer);
> drop table dud_table;
> Invariably, after some period of time, the second connection (B) will
> hang.

It would help if you would quantify how many create/drop pairs it takes.

> Note: Problem may be limited to Windows installation (cygipc?); have
> reproduced on "virgin" Win2K; have not been able to reproduce under
> Linux

If you've tried and failed to reproduce on Linux then the most likely
bet is that it's a Cygwin bug. But it would be good to try on some
other Unixoid platforms before pointing a finger in that direction.

regards, tom lane