Hello Tatsuo,<br><br>Thank you for replying!<br><br>I&#39;m not sure what exactly is blocking, just by pgpool code analysis I suspect it is the part where a connection is made to the db and it doesn&#39;t seem to get interrupted by alarm. Tested thoroughly health check behaviour, it works really well when host/ip is there and just backend/postgres is down, but not when backend host/ip is down. I could see in log that initial health check and each retry got delayed when host/ip is not reachable, while when just backend is not listening (is down) on the reachable host/ip then initial health check and all retries are exact to the settings in pgpool.conf.<br>
<br>PGCONNECT_TIMEOUT is listed as one of the libpq environment variables in the docs (see <a href="http://www.postgresql.org/docs/9.1/static/libpq-envars.html">http://www.postgresql.org/docs/9.1/static/libpq-envars.html</a> )<br>
There is equivalent parameter in libpq PGconnectdbParams ( see <a href="http://www.postgresql.org/docs/9.1/static/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT">http://www.postgresql.org/docs/9.1/static/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT</a> )<br>
At the beginning of that same page there are some important infos on using these functions.<br><br>psql respects PGCONNECT_TIMEOUT.<br><br>Regards,<br>Stevo.<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 12:13 AM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">&gt; Hello pgpool community,<br>
&gt;<br>
&gt; When system is configured for security reasons not to return destination<br>
&gt; host unreachable messages, even though health_check_timeout is configured,<br>
&gt; socket call will block and alarm will not get raised until TCP timeout<br>
&gt; occurs.<br>
<br>
</div>Interesting. So are you saying that read(2) cannot be interrupted by<br>
alarm signal if the system is configured not to return destination<br>
host unreachable message? Could you please guide me where I can get<br>
such that info? (I&#39;m not a network expert).<br>
<div class="im"><br>
&gt; Not a C programmer, found some info that select call could be replace with<br>
&gt; select/pselect calls. Maybe it would be best if PGCONNECT_TIMEOUT value<br>
&gt; could be used here for connection timeout. pgpool has libpq as dependency,<br>
&gt; why isn&#39;t it using libpq for the healthcheck db connect calls, then<br>
&gt; PGCONNECT_TIMEOUT would be applied?<br>
<br>
</div>I don&#39;t think libpq uses select/pselect for establishing connection,<br>
but using libpq instead of homebrew code seems to be an idea. Let me<br>
think about it.<br>
<br>
One question. Are you sure that libpq can deal with the case (not to<br>
return destination host unreachable messages) by using<br>
PGCONNECT_TIMEOUT?<br>
<span class="HOEnZb"><font color="#888888">--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
</font></span></blockquote></div><br>