Re: Re: [GENERAL] libpq error codes - Mailing list pgsql-patches

From Tom Lane
Subject Re: Re: [GENERAL] libpq error codes
Date
Msg-id 8755.961687055@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] libpq error codes  (Denis Perchine <dyp@perchine.com>)
Responses Re: Re: [GENERAL] libpq error codes  (Denis Perchine <dyp@perchine.com>)
List pgsql-patches
Denis Perchine <dyp@perchine.com> writes:
> db=> select count(*) from pg_class;
> pqReadData() -- backend closed the channel unexpectedly.
>         This probably means the backend terminated abnormally
>         before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> !>

> Looks much more reasonable. But I do not get messages about shutdown.
> With a patch enclosed it will perform like with ECONNRESET.
> Shouldn't I emulate EOF when EPIPE?

You *are* emulating EOF --- with that check in place, pqReadData
should respond to EPIPE just like it does to a normal EOF.  I don't
understand why you aren't seeing the same results I do.

How exactly are you testing this?  I'm doing it with a plain "kill"
on the connected backend process.  If you were using "kill -9"
or some such, that'd explain it --- the backend doesn't have an
opportunity to send the "I'm shutting down" message in that case.

            regards, tom lane

pgsql-patches by date:

Previous
From: Denis Perchine
Date:
Subject: Re: [GENERAL] libpq error codes
Next
From: Denis Perchine
Date:
Subject: Re: Re: [GENERAL] libpq error codes