RE: Terminate the idle sessions

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
To: 'Li Japin' <japinli@hotmail.com>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, 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-19T08:32:46Z
Lists: pgsql-hackers
Dear Li,

> Thanks for your suggestion.  Attached!

I prefer your comments:-).

I think this patch is mostly good.
I looked whole the codes again and I found the following comment in the PostgresMain():

```c
		/*
		 * (5) turn off the idle-in-transaction timeout
		 */
```

Please mention about idle-session timeout and check another comment.

Best Regards, 
Hayato Kuroda

Commits

  1. Rethink SQLSTATE code for ERRCODE_IDLE_SESSION_TIMEOUT.

  2. Improve commentary in timeout.c.

  3. Add idle_session_timeout.

  4. Improve timeout.c's handling of repeated timeout set/cancel.