RE: Question about client_connection_check_interval - Mailing list pgsql-hackers

From kuroda.hayato@fujitsu.com
Subject RE: Question about client_connection_check_interval
Date
Msg-id TYAPR01MB586677B6ED5FF422F63DA677F5B49@TYAPR01MB5866.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Question about client_connection_check_interval  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List 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




pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Proposal: allow database-specific role memberships
Next
From: Masahiko Sawada
Date:
Subject: Re: Parallel vacuum workers prevent the oldest xmin from advancing