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

Muhammad Usama m.usama at gmail.com
Thu Aug 18 22:20:37 JST 2016


On Thu, Aug 18, 2016 at 4:29 PM, Yugo Nagata <nagata at sraoss.co.jp> wrote:

> 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.
>

Yes, this is correct processType check should not be required, I was little
too much pessimistic

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

Yes, that is my intention for the patch to make sure
health_check_timer_handler was called before declaring it as a health check
alarm expired.
Thanks for your input I will make the change.

Regards
Muhammad Usama


> 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>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20160818/ac9aca45/attachment-0001.html>


More information about the pgpool-hackers mailing list