<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 18, 2016 at 4:29 PM, Yugo Nagata <span dir="ltr"><<a href="mailto:nagata@sraoss.co.jp" target="_blank">nagata@sraoss.co.jp</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Usama,<br>
<br>
I couldn't think the situation such that processState == PERFORMING_HEALTH_CHECK<br>
in processes other than PT_MAIN, because health check is performed only by the<br>
main process. Though your patch might be safer than mine, neither can<br>
processType == PT_MAIN say whetehr the signal is SIGALRM or not.<br></blockquote><div><br></div><div>Yes, this is correct processType check should not be required, I was little too much pessimistic</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Maybe, using health_check_timer_expired flag is better approach to make sure<br>
that health_check_timer_handler was called.<br></blockquote><div><br></div><div>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. </div><div>Thanks for your input I will make the change.</div><div><br></div><div>Regards</div><div>Muhammad Usama</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class=""><div class="h5"><br>
On Thu, 18 Aug 2016 15:56:30 +0500<br>
Muhammad Usama <<a href="mailto:m.usama@gmail.com">m.usama@gmail.com</a>> wrote:<br>
<br>
> Hi Yugo.<br>
><br>
> I was looking at the code and this commit. You are only checking the<br>
> pocessState in pool_check_fd() to declare if the timeout has<br>
> occurred during a health check. Shouldn't we also check if the signal was<br>
> actually the health check timer expire to make sure that we do not declare<br>
> the timer expire because of some other signal arrived while waiting for<br>
> data.<br>
><br>
> Can you please have a look at the attached patch to do the same, Do you<br>
> think it is the right approach?<br>
><br>
> Thanks<br>
> Kind regards<br>
> Muhammad Usama<br>
><br>
><br>
> On Wed, Jun 8, 2016 at 5:15 PM, Yugo Nagata <<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>> wrote:<br>
><br>
> > Fix a posible hang during health checking<br>
> ><br>
> > Helath checking was hang when any data wasn't sent<br>
> > from backend after connect(2) succeeded. To fix this,<br>
> > pool_check_fd() returns 1 when select(2) exits with<br>
> > EINTR due to SIGALRM while health checkking is performed.<br>
> ><br>
> > Reported and patch provided by harukat and some modification<br>
> > by Yugo. Per bug #204.<br>
> ><br>
> > Branch<br>
> > ------<br>
> > V3_4_STABLE<br>
> ><br>
> > Details<br>
> > -------<br>
> > <a href="http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=" rel="noreferrer" target="_blank">http://git.postgresql.org/<wbr>gitweb?p=pgpool2.git;a=<wbr>commitdiff;h=</a><br>
> > ed9f2900f1b611f5cfd52e8f758c36<wbr>16861e60c0<br>
> ><br>
> > Modified Files<br>
> > --------------<br>
> > src/protocol/pool_process_<wbr>query.c | 10 ++++++++++<br>
> > 1 file changed, 10 insertions(+)<br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > pgpool-committers mailing list<br>
> > <a href="mailto:pgpool-committers@pgpool.net">pgpool-committers@pgpool.net</a><br>
> > <a href="http://www.pgpool.net/mailman/listinfo/pgpool-committers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-committers</a><br>
> ><br>
<br>
<br>
</div></div><span class=""><font color="#888888">--<br>
Yugo Nagata <<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>><br>
</font></span></blockquote></div><br></div></div>