Re: [patch] helps fe-connect.c handle -EINTR more gracefully

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Дата
Msg-id Pine.LNX.4.30.0110262049360.628-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: [patch] helps fe-connect.c handle -EINTR more gracefully  (David Ford <david@blue-labs.org>)
Ответы Re: [patch] helps fe-connect.c handle -EINTR more gracefully  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: David Ford
Дата:
Сообщение: Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [patch] helps fe-connect.c handle -EINTR more gracefully