Re: [patch] helps fe-connect.c handle -EINTR more gracefully - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Date
Msg-id Pine.LNX.4.30.0110262049360.628-100000@peter.localdomain
Whole thread Raw
In response to Re: [patch] helps fe-connect.c handle -EINTR more gracefully  (David Ford <david@blue-labs.org>)
Responses Re: [patch] helps fe-connect.c handle -EINTR more gracefully
List pgsql-hackers
David Ford writes:

> Libpq doesn't deal with system calls being interrupted in the slightest.
>  None of the read/write or socket calls handle any errors.  Even benign
> returns i.e. EINTR are treated as fatal errors and returned.  Not to
> malign, but there is no reason not to continue on and handle EINTR.

Libpq certainly does deal with system calls being interrupted:  It does
not allow them to be interrupted.  Take a look into the file pqsignal.c to
see why.

If your alarm timer interrupts system calls then that's because you have
installed your signal handler to allow that.  In my mind, a reasonable
behaviour in that case would be to let the PQconnect or equivalent fail
and provide the errno to the application.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-hackers by date:

Previous
From: David Ford
Date:
Subject: Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Next
From: Tom Lane
Date:
Subject: Re: [patch] helps fe-connect.c handle -EINTR more gracefully