Re: Terminate the idle sessions
Japin Li <japinli@hotmail.com>
From: Li Japin <japinli@hotmail.com>
To: "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, "bharath.rupireddyforpostgres@gmail.com" <bharath.rupireddyforpostgres@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2020-11-16T12:40:57Z
Lists: pgsql-hackers
Attachments
- v5-0001-Allow-terminating-the-idle-sessions.patch (application/octet-stream) patch v5-0001
- v5-0002-Optimize-setitimer-usage.patch (application/octet-stream) patch v5-0002
Hi Kuroda,
On Nov 16, 2020, at 1:22 PM, kuroda.hayato@fujitsu.com<mailto:kuroda.hayato@fujitsu.com> wrote:
@@ -30,6 +30,7 @@ typedef enum TimeoutId
STANDBY_DEADLOCK_TIMEOUT,
STANDBY_TIMEOUT,
STANDBY_LOCK_TIMEOUT,
+ IDLE_SESSION_TIMEOUT,
IDLE_IN_TRANSACTION_SESSION_TIMEOUT,
/* First user-definable timeout reason */
USER_TIMEOUT,
I'm not familiar with timeout, but I can see that the priority of idle-session is set lower than transaction-timeout.
Could you explain the reason? In my image this timeout locates at the lowest layer, so it might have the lowest
priority.
My apologies! I just add a enum for idle session and ignore the comments that says the enum has priority.
Fixed as follows:
@@ -30,8 +30,8 @@ typedef enum TimeoutId
STANDBY_DEADLOCK_TIMEOUT,
STANDBY_TIMEOUT,
STANDBY_LOCK_TIMEOUT,
- IDLE_SESSION_TIMEOUT,
IDLE_IN_TRANSACTION_SESSION_TIMEOUT,
+ IDLE_SESSION_TIMEOUT,
/* First user-definable timeout reason */
USER_TIMEOUT,
/* Maximum number of timeout reasons */
Thanks for your review! Attached.
--
Best regards
Japin Li
Commits
-
Rethink SQLSTATE code for ERRCODE_IDLE_SESSION_TIMEOUT.
- 4edf96846a02 14.0 landed
-
Improve commentary in timeout.c.
- 9486e7b666fd 14.0 landed
-
Add idle_session_timeout.
- 9877374bef76 14.0 landed
-
Improve timeout.c's handling of repeated timeout set/cancel.
- 09cf1d522676 14.0 landed