Skip site navigation (1) Skip section navigation (2)

python - fe: Fix dead-end detection.

From: jwp(at)pgfoundry(dot)org (James William Pye)
To: pgsql-committers(at)postgresql(dot)org
Subject: python - fe: Fix dead-end detection.
Date: 2006-02-12 05:44:12
Message-ID: 20060212054412.7D01E1033806@pgfoundry.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix dead-end detection.

This resolves Proboscis' failure to detect the death of the remote end[1]. This
can occur if the backend segfaults out; while this won't normally happen, if it
does, Python's process use will go through the roof in an infinite loop.
An earlier patch resolved the issue with seeing PANIC messages and treating
them as fatal errors.

Additionally, this resolves an issue where Python's CPU use goes through the
roof when processing queries that take exceptional amounts of time to finish.
This is due to transport's former use of non-blocking reads.

This fixes the issue by requiring that at least one byte be read from the pipe.
For sockets, this is done giving the MSG_WAITALL flag to recv.

[1] http://pgfoundry.org/tracker/index.php?func=detail&aid=1000533&group_id=1000094&atid=442

Modified Files:
--------------
    fe/src:
        tracenull.py (r1.5 -> r1.6)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/fe/src/tracenull.py.diff?r1=1.5&r2=1.6)
        transport.py (r1.1.1.1 -> r1.2)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/fe/src/transport.py.diff?r1=1.1.1.1&r2=1.2)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2006-02-12 06:03:39
Subject: pgsql: Allow PL/pgSQL FOR statement to return values to scalars as well
Previous:From: Bruce MomjianDate: 2006-02-12 05:24:38
Subject: pgsql: Use 0x01 for newlines in saved history.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group