You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Leif Mortenson <le...@tanukisoftware.com> on 2002/08/23 10:41:30 UTC

AlrRMI Reconnect problem / Questions

I have been working on improving the Instrument Client code.  But I am 
still running into
a problem with the Altrmi implementation.   The client is designed to 
stay running across multiple
invocations of the server.  This makes it very useful for development as 
the client can just be
left running and it will automatically reconnect when the server comes 
back up.

The Client has its own reconnect code.  And everything is working fine.

But.  The underlying Altrmi client code is going into a loop when the 
server dies.  It tries
to reconnect to the server.  That would be fine if the connect dropped 
for some reason
and came back.  But is what is happening is that the Server JVM is being 
restarted.  When
the Client reconnects to the new server, Altrmi is having problems 
because it is unable to
locate the objects that were there before the connection dropped.  This 
results in the following
messages being output to the server console:
---
missing weak reference for referenceID - 25 pub 
InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor
missing weak reference for referenceID - 153 pub 
InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor
missing weak reference for referenceID - 121 pub 
InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor
missing weak reference for referenceID - 122 pub 
InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor
missing weak reference for referenceID - 19 pub 
InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor
missing weak reference for referenceID - 155 pub 
InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor
---

On the client console, you see output like the following:
---
InstrumentManagerTreeModel.closed(org.apache.excalibur.instrument.client.InstrumentManagerConnection[,2,25,254x934,layout=java.awt.BorderLayout,alignmentX=null,alignmentY=null,border=,flags=0,maximumSize=,minimumSize=,preferredSize=])
AltRMI service abnormally ended, Trying to reconnect (attempt 0)
AltRMI service abnormally ended, Trying to reconnect (attempt 1)
AltRMI service abnormally ended, Trying to reconnect (attempt 2)
org.apache.excalibur.altrmi.common.AltrmiInvocationException: Too many 
retries on abended service
        at 
org.apache.excalibur.altrmi.client.impl.DefaultConnectionListener.serviceAbend(DefaultConnectionListener.java:101)
        at 
org.apache.excalibur.altrmi.client.impl.stream.StreamInvocationHandler.handleInvocation(StreamInvocationHandler.java:174)
        at 
org.apache.excalibur.altrmi.client.impl.AbstractClientInvocationHandler.ping(AbstractClientInvocationHandler.java:92)
        at 
org.apache.excalibur.altrmi.client.impl.DefaultConnectionPinger.ping(DefaultConnectionPinger.java:48)
        at 
org.apache.excalibur.altrmi.client.impl.AbstractConnectionPinger.run(AbstractConnectionPinger.java:102)
        at java.lang.Thread.run(Thread.java:536)
AltRMI service abnormally ended, Trying to reconnect (attempt 0)
AltRMI service abnormally ended, Trying to reconnect (attempt 1)
AltRMI service abnormally ended, Trying to reconnect (attempt 2)
AltRMI service abnormally ended, Trying to reconnect (attempt 0)
AltRMI service abnormally ended, Trying to reconnect (attempt 1)
AltRMI service abnormally ended, Trying to reconnect (attempt 2)
...
---

It seems like Altrmi needs to have a way of detecting that the server 
JVM is not the same as what
it had been connected to before.  If the client finds that it has 
connected to a new server, then it
should give up on reconnecting and close as it is really not possible to 
restablish the connection
any longer.

In the specific case of the instrument client, it handles all 
reconnecting on its own.  So the desired
behaviour of Alrrmi would be to just close and not even try to 
reconnect.  Is there a way to do
this in the current implementation?

Cheers,
Leif


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AlrRMI Reconnect problem / Questions

Posted by Leif Mortenson <le...@tanukisoftware.com>.
Ok, I was able to get this working with a patch to 
DefaultConnectionListener.  Everything else was there :-)
It is now possible to tell the ConnectionListener how many times to 
attempt to reconnect.  In the Instrument
Client case, this is set to 0.

But.   While this works around the problem, I still think there is a 
problem in the way reconnects are handled
as described below.

Also, are there any plans to add Logging to the Altrmi code? It would be 
really nice to be able to turn on
and off debugging to get a feel for how it is working and to be able to 
track down problems.  As it already
depends on Framework, that shouldn't add any dependiencies.

Cheers,
Leif

Leif Mortenson wrote:

> I have been working on improving the Instrument Client code.  But I am 
> still running into
> a problem with the Altrmi implementation.   The client is designed to 
> stay running across multiple
> invocations of the server.  This makes it very useful for development 
> as the client can just be
> left running and it will automatically reconnect when the server comes 
> back up.
>
> The Client has its own reconnect code.  And everything is working fine.
>
> But.  The underlying Altrmi client code is going into a loop when the 
> server dies.  It tries
> to reconnect to the server.  That would be fine if the connect dropped 
> for some reason
> and came back.  But is what is happening is that the Server JVM is 
> being restarted.  When
> the Client reconnects to the new server, Altrmi is having problems 
> because it is unable to
> locate the objects that were there before the connection dropped.  
> This results in the following
> messages being output to the server console:
> ---
> missing weak reference for referenceID - 25 pub 
> InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor 
>
> missing weak reference for referenceID - 153 pub 
> InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor 
>
> missing weak reference for referenceID - 121 pub 
> InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor 
>
> missing weak reference for referenceID - 122 pub 
> InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor 
>
> missing weak reference for referenceID - 19 pub 
> InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor 
>
> missing weak reference for referenceID - 155 pub 
> InstrumentManagerClient_org$apache$excalibur$instrument$manager$interfaces$InstrumentSampleDescriptor 
>
> ---
>
> On the client console, you see output like the following:
> ---
> InstrumentManagerTreeModel.closed(org.apache.excalibur.instrument.client.InstrumentManagerConnection[,2,25,254x934,layout=java.awt.BorderLayout,alignmentX=null,alignmentY=null,border=,flags=0,maximumSize=,minimumSize=,preferredSize=]) 
>
> AltRMI service abnormally ended, Trying to reconnect (attempt 0)
> AltRMI service abnormally ended, Trying to reconnect (attempt 1)
> AltRMI service abnormally ended, Trying to reconnect (attempt 2)
> org.apache.excalibur.altrmi.common.AltrmiInvocationException: Too many 
> retries on abended service
>        at 
> org.apache.excalibur.altrmi.client.impl.DefaultConnectionListener.serviceAbend(DefaultConnectionListener.java:101) 
>
>        at 
> org.apache.excalibur.altrmi.client.impl.stream.StreamInvocationHandler.handleInvocation(StreamInvocationHandler.java:174) 
>
>        at 
> org.apache.excalibur.altrmi.client.impl.AbstractClientInvocationHandler.ping(AbstractClientInvocationHandler.java:92) 
>
>        at 
> org.apache.excalibur.altrmi.client.impl.DefaultConnectionPinger.ping(DefaultConnectionPinger.java:48) 
>
>        at 
> org.apache.excalibur.altrmi.client.impl.AbstractConnectionPinger.run(AbstractConnectionPinger.java:102) 
>
>        at java.lang.Thread.run(Thread.java:536)
> AltRMI service abnormally ended, Trying to reconnect (attempt 0)
> AltRMI service abnormally ended, Trying to reconnect (attempt 1)
> AltRMI service abnormally ended, Trying to reconnect (attempt 2)
> AltRMI service abnormally ended, Trying to reconnect (attempt 0)
> AltRMI service abnormally ended, Trying to reconnect (attempt 1)
> AltRMI service abnormally ended, Trying to reconnect (attempt 2)
> ...
> ---
>
> It seems like Altrmi needs to have a way of detecting that the server 
> JVM is not the same as what
> it had been connected to before.  If the client finds that it has 
> connected to a new server, then it
> should give up on reconnecting and close as it is really not possible 
> to restablish the connection
> any longer.
>
> In the specific case of the instrument client, it handles all 
> reconnecting on its own.  So the desired
> behaviour of Alrrmi would be to just close and not even try to 
> reconnect.  Is there a way to do
> this in the current implementation?
>
> Cheers,
> Leif
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>