Re: Escaping from blocked send() reprised.

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Escaping from blocked send() reprised.
Дата
Msg-id 20150110015907.GE12509@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Escaping from blocked send() reprised.  (Alex Shulgin <ash@commandprompt.com>)
Список pgsql-hackers
On 2014-11-17 18:22:54 +0300, Alex Shulgin wrote:
> 
> Andres Freund <andres@2ndquadrant.com> writes:
> >
> > I've invested some more time in this:
> > 0002 now makes sense on its own and doesn't change anything around the
> >      interrupt handling. Oh, and it compiles without 0003.
> 
> In this patch, the endif appears to be misplaced in PostgresMain:
> 
> +    if (MyProcPort != NULL)
> +    {
> +#ifdef WIN32
> +        pgwin32_noblock = true;
> +#else
> +        if (!pg_set_noblock(MyProcPort->sock))
> +            ereport(COMMERROR,
> +                    (errmsg("could not set socket to nonblocking mode: %m")));
> +    }
> +#endif
> +

Uh. Odd. Anyway, that bit of code is now somewhere else anyway...

> One thing I did try is sending a NOTICE to the client when in
> ProcessInterrupts() and DoingCommandRead is true.  I think[1] it was
> expected to be delivered instantly, but actually the client (psql) only
> displays it after sending the next statement.

Yea, that should be psql specific though. I hope ;)

> While I'm reading on FE/BE protocol someone might want to share his
> wisdom on this subject.  My guess: psql blocks on readline/libedit call
> and can't effectively poll the server socket before complete input from
> user.

I'm not sure if it's actually a "can't". It doesn't at least ;)

Greetings,

Andres Freund



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

Предыдущее
От: Aaron Botsis
Дата:
Сообщение: Re: Patch: [BUGS] BUG #12320: json parsing with embedded double quotes
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Fixing memory leak in pg_upgrade