Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 2F73E52A021 for ; Wed, 4 Jan 2012 22:37:13 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RidCZ-0007iq-8v for pgsql-bugs@postgresql.org; Thu, 05 Jan 2012 02:37:12 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q052avLX003742; Wed, 4 Jan 2012 21:36:57 -0500 (EST) To: "Ryan P. Kelly" cc: pgsql-bugs@postgresql.org Subject: Re: [PATCH] Prevent hanging on unreachable hosts on startup In-reply-to: <20120105011730.GA26760@llserver.lakeliving.com> References: <20120105011730.GA26760@llserver.lakeliving.com> Comments: In-reply-to "Ryan P. Kelly" message dated "Wed, 04 Jan 2012 20:17:30 -0500" Date: Wed, 04 Jan 2012 21:36:57 -0500 Message-ID: <3741.1325731017@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -3.8 (---) X-Archive-Number: 201201/33 X-Sequence-Number: 32100 "Ryan P. Kelly" writes: > The signal handler installed by setup_cancel_handler() will ignore > attempts to exit psql should a host be unreachable. Hm. That may be worth doing something about, but the proposed patch seems more like a quick-and-dirty hack than a solution. The main thing I don't like about it is that if we care about this scenario during initial startup, we should also care about it during a \c command, but just delaying the installation of the signal handler won't fix that case. More generally, what if the server becomes unreachable mid-session? I'm not sure how much there is to be done about that case, since there's probably no good way to distinguish it from a query that takes a really long time. But if we're going to think about this, we might as well think about all the cases. regards, tom lane