[pgpool-hackers: 1765] Re: [pgpool-committers: 3252] pgpool: Fix a posible hang during health checking

Yugo Nagata nagata at sraoss.co.jp
Thu Aug 18 20:29:27 JST 2016


Hi Usama,

I couldn't think the situation such that processState == PERFORMING_HEALTH_CHECK
in processes other than PT_MAIN, because health check is performed only by the
main process. Though your patch might be safer than mine, neither can
processType == PT_MAIN say whetehr the signal is SIGALRM or not.

Maybe, using health_check_timer_expired flag is better approach to make sure
that health_check_timer_handler was called.

On Thu, 18 Aug 2016 15:56:30 +0500
Muhammad Usama <m.usama at gmail.com> wrote:

> Hi Yugo.
> 
> I was looking at the code and this commit. You are only checking the
> pocessState in pool_check_fd() to declare if the timeout has
> occurred during a health check. Shouldn't we also check if the signal was
> actually the health check timer expire to make sure that we do not declare
> the timer expire because of some other signal arrived while waiting for
> data.
> 
> Can you please have a look at the attached patch to do the same, Do you
> think it is the right approach?
> 
> Thanks
> Kind regards
> Muhammad Usama
> 
> 
> On Wed, Jun 8, 2016 at 5:15 PM, Yugo Nagata <nagata at sraoss.co.jp> wrote:
> 
> > Fix a posible hang during health checking
> >
> > Helath checking was hang when any data wasn't sent
> > from backend after connect(2) succeeded. To fix this,
> > pool_check_fd() returns 1 when select(2) exits with
> > EINTR due to SIGALRM while health checkking is performed.
> >
> > Reported and patch provided by harukat and some modification
> > by Yugo. Per bug #204.
> >
> > Branch
> > ------
> > V3_4_STABLE
> >
> > Details
> > -------
> > http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=
> > ed9f2900f1b611f5cfd52e8f758c3616861e60c0
> >
> > Modified Files
> > --------------
> > src/protocol/pool_process_query.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > _______________________________________________
> > pgpool-committers mailing list
> > pgpool-committers at pgpool.net
> > http://www.pgpool.net/mailman/listinfo/pgpool-committers
> >


-- 
Yugo Nagata <nagata at sraoss.co.jp>


More information about the pgpool-hackers mailing list