python - fe: Fix dead-end detection. - Mailing list pgsql-committers

From jwp@pgfoundry.org (James William Pye)
Subject python - fe: Fix dead-end detection.
Date
Msg-id 20060212054412.7D01E1033806@pgfoundry.org
Whole thread Raw
List 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:

Previous
From: momjian@postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Use 0x01 for newlines in saved history.
Next
From: momjian@postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Allow PL/pgSQL FOR statement to return values to scalars as well