Hello Tatsuo,<br><br>With backend0 on one host just configure following rule on other host where pgpool is:<br><br>iptables -A FORWARD -j REJECT --reject-with icmp-port-unreachable<br><br>and then have pgpool startup with health checking and retrying configured, and then pull network cable from backend0 host network interface.<br>
<br>Regards,<br>Stevo.<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 6:27 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">
I want to try to test the situation you descrived:<br>
<div class="im"><br>
&gt;&gt; &gt; When system is configured for security reasons not to return destination<br>
&gt;&gt; &gt; host unreachable messages, even though health_check_timeout is<br>
<br>
</div>But I don&#39;t know how to do it. I pulled out the network cable and<br>
pgpool detected it as expected. Also I configured the server which<br>
PostgreSQL is running on to disable the 5432 port. In this case<br>
connect(2) returned EHOSTUNREACH (No route to host) so pgpool detected<br>
the error as expected.<br>
<br>
Could you please instruct me?<br>
<div class="im HOEnZb">--<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>
<br>
</div><div class="HOEnZb"><div class="h5">&gt; Hello Tatsuo,<br>
&gt;<br>
&gt; Thank you for replying!<br>
&gt;<br>
&gt; I&#39;m not sure what exactly is blocking, just by pgpool code analysis I<br>
&gt; suspect it is the part where a connection is made to the db and it doesn&#39;t<br>
&gt; seem to get interrupted by alarm. Tested thoroughly health check behaviour,<br>
&gt; it works really well when host/ip is there and just backend/postgres is<br>
&gt; down, but not when backend host/ip is down. I could see in log that initial<br>
&gt; health check and each retry got delayed when host/ip is not reachable,<br>
&gt; while when just backend is not listening (is down) on the reachable host/ip<br>
&gt; then initial health check and all retries are exact to the settings in<br>
&gt; pgpool.conf.<br>
&gt;<br>
&gt; PGCONNECT_TIMEOUT is listed as one of the libpq environment variables in<br>
&gt; the docs (see <a href="http://www.postgresql.org/docs/9.1/static/libpq-envars.html" target="_blank">http://www.postgresql.org/docs/9.1/static/libpq-envars.html</a> )<br>
&gt; There is equivalent parameter in libpq PGconnectdbParams ( see<br>
&gt; <a href="http://www.postgresql.org/docs/9.1/static/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT" target="_blank">http://www.postgresql.org/docs/9.1/static/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT</a>)<br>

&gt; At the beginning of that same page there are some important infos on using<br>
&gt; these functions.<br>
&gt;<br>
&gt; psql respects PGCONNECT_TIMEOUT.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Stevo.<br>
&gt;<br>
&gt; On Wed, Jan 11, 2012 at 12:13 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; &gt; Hello pgpool community,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; When system is configured for security reasons not to return destination<br>
&gt;&gt; &gt; host unreachable messages, even though health_check_timeout is<br>
&gt;&gt; configured,<br>
&gt;&gt; &gt; socket call will block and alarm will not get raised until TCP timeout<br>
&gt;&gt; &gt; occurs.<br>
&gt;&gt;<br>
&gt;&gt; Interesting. So are you saying that read(2) cannot be interrupted by<br>
&gt;&gt; alarm signal if the system is configured not to return destination<br>
&gt;&gt; host unreachable message? Could you please guide me where I can get<br>
&gt;&gt; such that info? (I&#39;m not a network expert).<br>
&gt;&gt;<br>
&gt;&gt; &gt; Not a C programmer, found some info that select call could be replace<br>
&gt;&gt; with<br>
&gt;&gt; &gt; select/pselect calls. Maybe it would be best if PGCONNECT_TIMEOUT value<br>
&gt;&gt; &gt; could be used here for connection timeout. pgpool has libpq as<br>
&gt;&gt; dependency,<br>
&gt;&gt; &gt; why isn&#39;t it using libpq for the healthcheck db connect calls, then<br>
&gt;&gt; &gt; PGCONNECT_TIMEOUT would be applied?<br>
&gt;&gt;<br>
&gt;&gt; I don&#39;t think libpq uses select/pselect for establishing connection,<br>
&gt;&gt; but using libpq instead of homebrew code seems to be an idea. Let me<br>
&gt;&gt; think about it.<br>
&gt;&gt;<br>
&gt;&gt; One question. Are you sure that libpq can deal with the case (not to<br>
&gt;&gt; return destination host unreachable messages) by using<br>
&gt;&gt; PGCONNECT_TIMEOUT?<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;<br>
</div></div></blockquote></div><br>