Subject: Re: Got "broken pipe" exception
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 28 Nov 2007 01:45:41 -0600
Newsgroups: comp.lang.lisp
Message-ID: <iJqdnVmMtYU4gdDanZ2dnUVZ_hCdnZ2d@speakeasy.net>
Kamen TOMOV  <kamen@cybuild.com> wrote:
+---------------
| Trastabuga wrote:
| > Basically I form an http-request to some server and at times it
| > gives me the "broken pipe" exception.
| > I read that this exception happens when the server terminates the
| > connection on its end and the client still tries to use the socket.
+---------------

Yes. [It can also happen to the server when the client terminates.]

+---------------
| > I am wondering if you guys had it and how did you go about fixing it?
| 
| Fixing it on the client or on the server? 
+---------------

I had the same question! ;-}  If on the server side, it's something
a server *must* tolerate [mainly, by ignoring it and just CLOSE'ing
the connection when you get an EPIPE error], since clients (users on
borwsers) will *often* terminate a download in the middle, by hitting
"Stop" or by clicking a link before the whole page fills.

But it shouldn't be happening on the client side, at least not very often.

+---------------
| > I am using linux 2.6 kernel (debian), sbcl 1.0.11 and the latest
| > drakma related libraries.
| 
| If you are programming the client...
+---------------

Drakma is a client, so it sounds like that's what he's doing.

+---------------
| ...and you do not have control upon the server then your only
| options are to re-send the request and hope that it would pass. 
+---------------

That would be my advice, too, except with the addition of an
exponential backoff on the retries, in case it's a load-related
issue on the server.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607