<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">&lt;<a href="mailto:nagata@sraoss.co.jp" target="_blank">nagata@sraoss.co.jp</a>&gt;</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&#39;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 &lt;<a href="mailto:m.usama@gmail.com">m.usama@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi Yugo.<br>
&gt;<br>
&gt; I was looking at the code and this commit. You are only checking the<br>
&gt; pocessState in pool_check_fd() to declare if the timeout has<br>
&gt; occurred during a health check. Shouldn&#39;t we also check if the signal was<br>
&gt; actually the health check timer expire to make sure that we do not declare<br>
&gt; the timer expire because of some other signal arrived while waiting for<br>
&gt; data.<br>
&gt;<br>
&gt; Can you please have a look at the attached patch to do the same, Do you<br>
&gt; think it is the right approach?<br>
&gt;<br>
&gt; Thanks<br>
&gt; Kind regards<br>
&gt; Muhammad Usama<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Jun 8, 2016 at 5:15 PM, Yugo Nagata &lt;<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Fix a posible hang during health checking<br>
&gt; &gt;<br>
&gt; &gt; Helath checking was hang when any data wasn&#39;t sent<br>
&gt; &gt; from backend after connect(2) succeeded. To fix this,<br>
&gt; &gt; pool_check_fd() returns 1 when select(2) exits with<br>
&gt; &gt; EINTR due to SIGALRM while health checkking is performed.<br>
&gt; &gt;<br>
&gt; &gt; Reported and patch provided by harukat and some modification<br>
&gt; &gt; by Yugo. Per bug #204.<br>
&gt; &gt;<br>
&gt; &gt; Branch<br>
&gt; &gt; ------<br>
&gt; &gt; V3_4_STABLE<br>
&gt; &gt;<br>
&gt; &gt; Details<br>
&gt; &gt; -------<br>
&gt; &gt; <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>
&gt; &gt; ed9f2900f1b611f5cfd52e8f758c36<wbr>16861e60c0<br>
&gt; &gt;<br>
&gt; &gt; Modified Files<br>
&gt; &gt; --------------<br>
&gt; &gt; src/protocol/pool_process_<wbr>query.c | 10 ++++++++++<br>
&gt; &gt; 1 file changed, 10 insertions(+)<br>
&gt; &gt;<br>
&gt; &gt; ______________________________<wbr>_________________<br>
&gt; &gt; pgpool-committers mailing list<br>
&gt; &gt; <a href="mailto:pgpool-committers@pgpool.net">pgpool-committers@pgpool.net</a><br>
&gt; &gt; <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>
&gt; &gt;<br>
<br>
<br>
</div></div><span class=""><font color="#888888">--<br>
Yugo Nagata &lt;<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>&gt;<br>
</font></span></blockquote></div><br></div></div>