Re: Full socket send buffer prevents cancel, timeout

Поиск
Список
Период
Сортировка
От Stephen R. van den Berg
Тема Re: Full socket send buffer prevents cancel, timeout
Дата
Msg-id 20081027164319.GA26086@cuci.nl
обсуждение исходный текст
Ответ на Re: Full socket send buffer prevents cancel, timeout  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Full socket send buffer prevents cancel, timeout  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
>"Stephen R. van den Berg" <srb@cuci.nl> writes:
>> What about simply closing the filedescriptor upon discovering a
>> non-empty sendbuffer upon timeout/querycancel?

>So in other words, convert any network glitch, no matter how small,
>into an instant fatal error?

The fact that a timeout or querycancel has taken place, indicates that
this does *not* act on just any network glitch.
The preferred exact logic would look something like:

a. Take note of the time the last write returned as Tlastwritten.
b. Whenever a timeout occurs, or a querycancel is being requested:
c. Check if the sendbuffer is empty.
d. If the sendbuffer is non-empty *and* Tlastwritten is longer ago  than some Tkill (say 128 seconds), then close the
filedescriptor.

In all other cases, just hang on tight.
-- 
Sincerely,          Stephen R. van den Berg.

Teamwork is essential -- it allows you to blame someone else.


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: ERRORDATA_STACK_SIZE exceeded (server crash)
Следующее
От: Charles Duffy
Дата:
Сообщение: Re: Making pg_standby compression-friendly