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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Дата
Msg-id 23846.1004106136@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [patch] helps fe-connect.c handle -EINTR more gracefully  (Brent Verner <brent@rcfile.org>)
Список pgsql-hackers
Brent Verner <brent@rcfile.org> writes:
> | Unless someone can point out a situation where retrying connect()
> | after EINTR is actively bad, my inclination is to accept the patch.

>   I've found numerous examples where connect() is retried after EINTR,
> infact it appears to be fairly common.

Perhaps it does work that way on your system, but that's not the point.
On a machine that behaves that way, we'll never see EINTR returned by
connect(), and so our reaction to it is unimportant.  The question is
what we should do if we *do* get EINTR from connect().  AFAICS, the
appropriate response is to retry.  We already do retry after EINTR in
libpq's recv, send, select, etc calls --- perhaps connect got overlooked
because it's usually only done at program startup.

After further thought, though, it's unclear to me why this solves
David's problem.  If he's got a repeating SIGALRM on a cycle short
enough to interrupt a connect(), seems like it'd just fail again
on the next try.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

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