From: Trastabuga
Subject: Got "broken pipe" exception
Date: 
Message-ID: <ed5f5154-d63e-4266-8fc5-2f5f73dfec7c@e1g2000hsh.googlegroups.com>
I am using Edi's libraries like drakma, chunga based on usocket-0.3.5.
As this looks more like a general network question and might not be
related to Edi's libraries, I am asking it here looking for any ideas
why it might be happening.
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.
I am wondering if you guys had it and how did you go about fixing it?
Could it be just because the server to which I am trying to connect
just dis-behaves? Or could it the some unstable network connection
related to my router (linksys) or NIC?
I am using linux 2.6 kernel (debian), sbcl 1.0.11 and the latest
drakma related libraries.

Any ideas are welcome!
Andrew

From: Kamen TOMOV
Subject: Re: Got "broken pipe" exception
Date: 
Message-ID: <ur6ickosh.fsf@cybuild.com>
On Tue, Nov 27 2007, Trastabuga wrote:

> I am using Edi's libraries like drakma, chunga based on
> usocket-0.3.5.  As this looks more like a general network question
> and might not be related to Edi's libraries, I am asking it here
> looking for any ideas why it might be happening.
> 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.
> 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? 

> Could it be just because the server to which I am trying to connect
> just dis-behaves? Or could it the some unstable network connection
> related to my router (linksys) or NIC?

It could be any of these. Do you have control on the server?

> I am using linux 2.6 kernel (debian), sbcl 1.0.11 and the latest
> drakma related libraries.
>
> Any ideas are welcome!

If you are programming the client 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. 

If you are controlling both and this happens in "lab" conditions, than
you need to isolate the problem. I'd suggest try with different
clients and with different servers. Analyse your requests and
responses.

HTH,

-- 
Kamen
From: Rob Warnock
Subject: Re: Got "broken pipe" exception
Date: 
Message-ID: <iJqdnVmMtYU4gdDanZ2dnUVZ_hCdnZ2d@speakeasy.net>
Kamen TOMOV  <·····@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.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Kaz Kylheku
Subject: Re: Got "broken pipe" exception
Date: 
Message-ID: <7e4bb6d4-dc06-413e-8f6f-9d679477fbad@w34g2000hsg.googlegroups.com>
On Nov 26, 4:13 pm, Trastabuga <·········@gmail.com> wrote:
> I am using Edi's libraries like drakma, chunga based on usocket-0.3.5.
> As this looks more like a general network question and might not be
> related to Edi's libraries, I am asking it here looking for any ideas
> why it might be happening.
> Basically I form an http-request to some server and at times it gives
> me the "broken pipe" exception.

The obvious thing to do is to capture some packets.