Re: idle-in-transaction timeout error does not give a hint

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: idle-in-transaction timeout error does not give a hint
Дата
Msg-id 20181130.134650.1384832545661385359.t-ishii@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: idle-in-transaction timeout error does not give a hint  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Ответы RE: idle-in-transaction timeout error does not give a hint  ("Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>)
Список pgsql-hackers
Hi Ideriha-san,

>>>> Hi, it makes sense to me. One can submit transaction again same as
>>>> other cases you mentioned.
>>>>
>>>> I didn't attach the patch but according to my simple experiment in
>>>> psql the output would become the following:
>>>>
>>>> FATAL:  terminating connection due to idle-in-transaction timeout
>>>> HINT: In a moment you should be able to reconnect to the
>>>>       database and repeat your command.
>>>
>>>Alternative HINT message would be something like:
>>>
>>>HINT: In a moment you should be able to reconnect to the
>>>      database and restart your transaction.
>>>
>>>This could make the meaning of the error (transaction aborted) cleaner and might give
>>>a better suggestion to the user.
>> 
>> Agreed. Changing "command" to "transaction" seems more accurate. People might think
>> only the command they hit is not sent but transaction is still alive though it's of course unnatural
>> that transaction is alive after connection is terminated.
>> 
>> In this case you could change the comment issued by other errors mentioned while you're at it.
>> 
>> Regards,
>> Takeshi Ideriha
> 
> I have added this to the next CF (2019-01).

Please find attached patch which addresses the point above.

BTW, would you like to be added to the CF item as a reviewer?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 9a948f825d..27337a21da 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -3150,7 +3150,9 @@ ProcessInterrupts(void)
         if (IdleInTransactionSessionTimeout > 0)
             ereport(FATAL,
                     (errcode(ERRCODE_IDLE_IN_TRANSACTION_SESSION_TIMEOUT),
-                     errmsg("terminating connection due to idle-in-transaction timeout")));
+                     errmsg("terminating connection due to idle-in-transaction timeout"),
+                     errhint("In a moment you should be able to reconnect to the"
+                             " database and restart your transaction.")));
         else
             IdleInTransactionSessionTimeoutPending = false;


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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: spurious(?) warnings in archive recovery
Следующее
От: Nikhil Sontakke
Дата:
Сообщение: Re: [HACKERS] logical decoding of two-phase transactions