Read only archive ; use for new issues
Bug 701 - SocketException Broken pipe on server restart
Summary: SocketException Broken pipe on server restart
Status: RESOLVED DUPLICATE of bug 708
Alias: None
Product: JacORB
Classification: Unclassified
Component: ORB (show other bugs)
Version: 2.2.3
Hardware: Macintosh other
: P2 normal
Assignee: Gerald Brose
Depends on:
Reported: 2006-07-07 20:36 CEST by Philip Crotwell
Modified: 2006-12-01 20:46 CET (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Philip Crotwell 2006-07-07 20:36:07 CEST
I have a client and a server, both running JacORB. The client is coded so that
if it gets corba system exceptions when making a call on the server, it goes
back to the name service, re-resolves the server, and tries the call again. This
way the client doesn't have to be restarted every time the server is. However,
recently I restarted the server and the client dutifully resolved it again from
the name service, but when it remade the call, it received this SocketException.
I wonder if somehow JacOrb is still trying to use the old socket, which is no
longer valid, even though I have a brand new reference from the naming service.
The new instance of the server would be on the same machine and port, so it
might make some sense if the was socket caching, but I would think that JacORB
would try to create a new socket if the existing one was bad. 

Alternatively, is there a way to force JacORB to create a new socket once an
error like this shows up? I would very much like to find a way to keep my client
alive across server restarts.


org.omg.CORBA.COMM_FAILURE: IOException: Broken pipe 
vmcid: 0x0  minor code: 0  completed: No
        at org.jacorb.orb.giop.GIOPConnection.write(
        at org.jacorb.orb.CDROutputStream.write(
        at org.jacorb.orb.giop.GIOPConnection.sendMessage(
        at org.jacorb.orb.giop.GIOPConnection.sendRequest(
        at org.jacorb.orb.Delegate.invoke_internal(
        at org.jacorb.orb.Delegate.invoke(
        at org.omg.CORBA.portable.ObjectImpl._invoke(
Comment 1 Philip Crotwell 2006-11-29 19:05:11 CET
We have done some more testing, and believe that what is happening is that there
are more than one client object talking to the remote server. When there is a
low level problem with the socket, causing the "Broken Pipe", then the
ClientConnectionManager won't throw away the socket, even if we call _release().
The logging messages below occur when we retry, even after regeting the
reference from the name service and calling _release().

[jacorb.orb.giop] INFO : ClientConnectionManager: found ClientGIOPConnection to
x.y.z.129:6382 (d3a0c0b)
[jacorb.orb.giop] INFO : ClientConnectionManager: found ClientGIOPConnection to
x.y.z.129:6382 (d3a0c0b)
[jacorb.orb.giop] INFO : ClientConnectionManager: found ClientGIOPConnection to
x.y.z.129:6382 (d3a0c0b)

I think that once a "Broken Pipe" happens, the socket is dead, and any further
reuse by the orb is doomed to failure. It would really be nice if the system
would detect these IOExceptions and mark the socket as bad before throwing the
COMM_FAILURE. At least that way if the client retries the call, a new socket
will be created and there is a chance that the system can recover. As it is,
once this error happens, only killing and restarting the client will resolve the
Comment 2 Philip Crotwell 2006-12-01 20:46:49 CET
After looking into this, I believe this is a similar issue to 708

*** This bug has been marked as a duplicate of 708 ***