Question about client_connection_check_interval

From: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Thomas Munro' <thomas(dot)munro(at)gmail(dot)com>, "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Question about client_connection_check_interval
Date: 2021-10-07 03:07:33
Message-ID: TYAPR01MB5866752B234F969DC5732D14F5B19@TYAPR01MB5866.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Hackers,

While reading source codes about timeouts and GUC and I found that
strange behavior about client_connection_check_interval.

Currently we did not an assign_hook about client_connection_check_interval,
that means a timeout will not turn on immediately if users change the GUC
from zero to arbitrary positive integer.
In my understanding the timeout will fire only when:

* before starting transaction
* after firing the CLIENT_CONNECTION_CHECK_TIMEOUT timeout

Hence I thought following inconvenient scenario:

1. set client_connection_check_interval = 0 in postgresql.conf
2. start a tx
3. SET LOCAL client_connection_check_interval to non-zero value
in order to checking clients until the end of the tx
4. users expect to firing the timeout, but it does not work
because enable_timeout_after() will never execute in the tx

Is this an expected behavior? If so, I think this spec should be documented.
If not, I think an assign_hook is needed for resolving the problem.

How do you think?

Best Regards,
Hayato Kuroda
FUJITSU LIMITED

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-10-07 04:20:14 Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Previous Message Amit Langote 2021-10-07 03:04:58 Re: a comment in joinrel.c: compute_partition_bounds()