From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Greg Troxel Newsgroups: gmane.lisp.guile.user Subject: Re: Broken pipe errors using guile-pg with guile 1.8 Date: Mon, 23 Feb 2009 12:06:56 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1235409352 6496 80.91.229.12 (23 Feb 2009 17:15:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2009 17:15:52 +0000 (UTC) Cc: guile-user@gnu.org To: Sebastian Tennant Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Feb 23 18:17:07 2009 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LbeQF-0004bZ-3B for guile-user@m.gmane.org; Mon, 23 Feb 2009 18:16:52 +0100 Original-Received: from localhost ([127.0.0.1]:32835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbeOu-0000Gj-16 for guile-user@m.gmane.org; Mon, 23 Feb 2009 12:15:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LbeGi-0001Rl-AA for guile-user@gnu.org; Mon, 23 Feb 2009 12:07:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LbeGg-0001Oz-IR for guile-user@gnu.org; Mon, 23 Feb 2009 12:06:59 -0500 Original-Received: from [199.232.76.173] (port=45021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbeGg-0001OZ-A3 for guile-user@gnu.org; Mon, 23 Feb 2009 12:06:58 -0500 Original-Received: from fnord.ir.bbn.com ([192.1.100.210]:62797) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LbeGf-0005Sg-S3 for guile-user@gnu.org; Mon, 23 Feb 2009 12:06:57 -0500 Original-Received: by fnord.ir.bbn.com (Postfix, from userid 10853) id DC0135508; Mon, 23 Feb 2009 12:06:56 -0500 (EST) X-Hashcash: 1:20:090223:guile-user@gnu.org::jhGxLs72sWMSf36S:00000000000000000000000000000000000000000003qU+ X-Hashcash: 1:20:090223:sebyte@smolny.plus.com::jhGxLs72sWMSf36S:00000000000000000000000000000000000000063hf In-Reply-To: (Sebastian Tennant's message of "Mon, 23 Feb 2009 16:57:21 +0000") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (berkeley-unix) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7152 Archived-At: --=-=-= Sebastian Tennant writes: > Hi Guilers, > > Is anyone familiar with the internals of guile-pg (version 0.16, author > Ian Grant) which wraps PostgreSQL's libpq? By 0.16, I think you mean ttn's version of Ian Grant's abandoned 0.07 or so. > I'm getting a lot of 'broken pipe' errors of the sort: > > Feb 23 11:32:13 stderr: ERROR: In procedure pg-connectdb: > Feb 23 11:32:13 stderr: ERROR: could not send startup packet: Broken pipe > > It's especially bad at times of light load (rather than no load) and I > never once noticed this error whilst the webapp was in development > (i.e., I was the only person using it) which suggests to me that it's > happening whenever two or more page requests call scripts that attempt > to open database connections more or less at the same time. > > All my calls to pg-connectdb are let bound so database connections are > (supposed to be) closed after every query. I am not sure that gc will run as soon as you drop the reference, so you might want to force gc, or better yet explicitly close the db object. You could add a debug printf in the free/close function to check this hypothesis, but I think you should be explicitly closing the connection - gc should only be for memory, not external state - there's no hook to run gc when guile is out of file descriptors, for example. > Any advice very much appreciated. I've attached a log extract to give > you an idea of the frequency of failures. I need to find a solution to > this problem fast! > > Seb > > P.S. Perhaps upgrading guile-pg is the first thing I should try? IIRC > there's a more recent pkgsrc version (which is guile 1.8 > comaptible) somewhere... hunting for it now. I suspect a day or so of work would suffice to make the most recent guile-pg work with 1.8. If you do it definitely post patches. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (NetBSD) iEYEARECAAYFAkmi17AACgkQ+vesoDJhHiWsFACeNOV+j88A5KlSs3ROHeMjlBsg LYIAoLaAN8gm66m2D4orNsgRhJy3Vxwe =OKki -----END PGP SIGNATURE----- --=-=-=--