RE: Question about client_connection_check_interval

From: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Kyotaro Horiguchi' <horikyota(dot)ntt(at)gmail(dot)com>
Cc: "thomas(dot)munro(at)gmail(dot)com" <thomas(dot)munro(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Question about client_connection_check_interval
Date: 2021-10-10 23:51:57
Message-ID: TYAPR01MB586677B6ED5FF422F63DA677F5B49@TYAPR01MB5866.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Horiguchi-san,

Thank you for replying! I understood I was wrong. Sorry.

> You're misunderstanding here. Maybe you saw that start_xact_command()
> starts the timer but note that the function is called before every
> command execution.

Based on your advice I read codes again and I found that start_xact_command() is called
from exec_XXX functions.
They are called when backend processes read first char from front-end,
hence I agreed enable_timeout_after() will call very quickly if timeout is disabled.

> So this is wrong. I should see the check performed as expected. That
> behavior would be clearly visualized if you inserted an elog() into
> pq_check_connection().

Right. As mentioned above timeout is checked basically whenever reading commands.
I embedded elog() to ClientCheckTimeoutHandler() and visualized easily.

> And it seems that the documentation describes the behavior correctly.
>
> https://www.postgresql.org/docs/14/runtime-config-connection.html
>
> > client_connection_check_interval (integer)
> >
> > Sets the time interval between optional checks that the client is
> > still connected, while running queries.

Yeah I agreed that, I apologize for mistaking source and doc analysis.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-10-11 00:23:32 Re: Parallel vacuum workers prevent the oldest xmin from advancing
Previous Message David G. Johnston 2021-10-10 23:45:30 Re: Proposal: allow database-specific role memberships