Re: Idle In Transaction Session Timeout, revived

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Idle In Transaction Session Timeout, revived
Дата
Msg-id 24366.1454534703@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Idle In Transaction Session Timeout, revived  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Idle In Transaction Session Timeout, revived  (David Steele <david@pgmasters.net>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Feb 3, 2016 at 3:41 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
>> Wouldn't it be more sensible to just roll the transaction back and not
>> disconnect?

> It would be nice to be able to do that, but the client-server protocol
> can't handle it without losing sync.  Basically, if you send an error
> to an idle client, you have to kill the session.  This has come up
> many times before.

Well, you can't just spit out an unprompted error message and go back to
waiting for the next command; as Robert says, that would leave the wire
protocol state out of sync.  But in principle we could kill the
transaction and not say anything to the client right then.  Instead set
some state that causes the next command from the client to get an error.
(This would not be much different from what happens when you send a
command in an already-reported-failed transaction; though we'd want to
issue a different error message than for that case.)

I'm not sure how messy this would be in practice.  But if we think that
killing the whole session is not desirable but something we're doing for
expediency, then it would be worth looking into that approach.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL Audit Extension
Следующее
От: David Steele
Дата:
Сообщение: Re: Idle In Transaction Session Timeout, revived