[PATH] Idle in transaction cancellation

Поиск
Список
Период
Сортировка
От Andres Freund
Тема [PATH] Idle in transaction cancellation
Дата
Msg-id 201010171958.44191.andres@anarazel.de
обсуждение исходный текст
Ответы Re: [PATH] Idle in transaction cancellation  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
Hi all.

Here is a proposed patch which enables cancellation of $subject. The 
problematic point about doing so is that the client is not expecting any 
messages from the server when its in an idle state during an transaction and 
that simply suppressing that message is not enough as ready for query messages 
would get sent out at unexpected places.

Thus the first patch adds the possibility to add flags to ereport()s error level 
to suppress notifying the client.
It also switches the earlier "COMERROR" log level over to this flag 
(LOG_NO_CLIENT) with a typedef to support the old method.

The second patch sets up a variable "silent_error_while_idle" when its 
cancelling an idle txn which suppresses sending out messages at wrong places 
and resets its  after having read a command in the simple protocol and after 
having read a 'sync' message in the extended protocol.

Currently it does *not* report any special error message to the client if it 
starts sending commands in an (unbekownst to it) failed transaction, but just 
the normal "25P02: current transaction is aborted..." message.

It shouldn't be hard to add that and I will propose a patch if people would 
like it (I personally am not very interested, but I can see people validly 
wanting it), but I would like to have some feedback on the patch first.

Greetings,

Andres




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: WIP: extensible enums
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: WIP: extensible enums