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. thanks, Philip org.omg.CORBA.COMM_FAILURE: IOException: java.net.SocketException: Broken pipe vmcid: 0x0 minor code: 0 completed: No at org.jacorb.orb.etf.ConnectionBase.to_COMM_FAILURE(ConnectionBase.java:129) at org.jacorb.orb.etf.StreamConnectionBase.write(StreamConnectionBase.java:144) at org.jacorb.orb.giop.GIOPConnection.write(GIOPConnection.java:769) at org.jacorb.orb.CDROutputStream.write(CDROutputStream.java:414) at org.jacorb.orb.giop.ServiceContextTransportingOutputStream.write_to(ServiceContextTransportingOutputStream.java:143) at org.jacorb.orb.giop.RequestOutputStream.write_to(RequestOutputStream.java:259) at org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:851) at org.jacorb.orb.giop.GIOPConnection.sendRequest(GIOPConnection.java:805) at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:302) at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:282) at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:912) at org.jacorb.orb.Delegate.invoke(Delegate.java:857) at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457) at edu.sc.seis.IfReceiverFunction._RecFuncCacheStub.isCached(_RecFuncCacheStub.java:56)
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 problem.
After looking into this, I believe this is a similar issue to 708 *** This bug has been marked as a duplicate of 708 ***