Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id DE6CA2E0047 for ; Wed, 7 May 2008 20:46:46 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 78096-02 for ; Wed, 7 May 2008 20:46:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.238]) by developer.postgresql.org (Postfix) with ESMTP id 7F4CE2E002D for ; Wed, 7 May 2008 20:46:41 -0300 (ADT) Received: by qb-out-0506.google.com with SMTP id a39so650736qbd.17 for ; Wed, 07 May 2008 16:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=17ygLrPk2i7n9pg6nsvHJ2lkSiPzk009y0s11a/+UkQ=; b=CTfptTBtlrjGAwEPqKp1a6DblzOXzPaxQQGz2y7jtRMcEiyTboiT+AMDcsK+9UZnnnbGPIjqiIwdgoed0/6kfrBFkWzcxywZxvzPrtdFi/NnZAZSVjUmsSONcKMUQByMhWwtudmy7SZnlR1GP8AV3YsHUqQo3Ciq+MFjO02hdt8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AsBDhTfQ/IG3CvZgQlD+YRzLP21LXnm2YUPKKGwuK45nDO6LMjOTXzA7fo0TZQTAklbqKecMfFR/RJy26ZpRfUoON1N6aYBkvCepn0c2guk8mzZSrEtRLTI4++pgA2ggNPRXOXIeg5igRKkPyFb+knizp3SgZxjzKNzGuGgwZ74= Received: by 10.114.135.1 with SMTP id i1mr2484607wad.88.1210203999599; Wed, 07 May 2008 16:46:39 -0700 (PDT) Received: by 10.114.137.7 with HTTP; Wed, 7 May 2008 16:46:39 -0700 (PDT) Message-ID: Date: Wed, 7 May 2008 17:46:39 -0600 From: "Scott Marlowe" To: darrenr@fastmail.net Subject: Re: postgres doesn't detect other end of the unix socket is gone... Cc: "pgsql-admin@postgresql.org" In-Reply-To: <48223B31.4090206@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48223B31.4090206@fastmail.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/58 X-Sequence-Number: 29142 On Wed, May 7, 2008 at 5:28 PM, Darren Reed wrote: > It would appear that sometimes, when a disconnect a unix stream > (ie perl DBI) from postgres in a forceful manner (^C), postgres > doesn't appear to notice and keeps processing the transaction > rather than aborting it. Well, how much time should postgresql spend polling all it's connections to see if they're dead? Generally speaking, it's the client's job to notify the server when it disconnects. > In this case, it would appear that 586 hasn't noticed anything strange > happening. Should it have? Nope, not its job really. > Will this problem go away if I use TCP rather than unix streams? tcp connections use keepalive to harvest such connections. the default setting is 2+hours to notice and drop them. but you can set tcp_keepalive_time to something like 300 (5 minutes) and they'll be harvested much more quickly. > Or is this a bug of the variety that when postgres is deep inside > an UPDATE, doing lots of disk I/O, it never checks to see if it > should abort because the client has gone? It just never checks. Not a bug really. > Actually, I can see aborting being a bug too...is there a way to > control the behaviour here? Once the OS on the pgsql side notices the disconnect, the standard behaviour is to rollback whatever transaction you're in and exit.