You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2009/10/05 10:03:00 UTC

Slow RMI Host start up

The caclulator-rmi sample keeps failing on the hudson build as the
client runs before the service has finished starting up. I've stepped
through the code to try to find why its so slow and it turns out to be
"this.factory = SocketFactory.getDefault();" in the constructor of
org/apache/tuscany/sca/host/rmi/RMISocketFactoryImpl that takes all
the time, around 20 seconds on my machine. Before i go spending time
investigate whats going does anyone know what could be going on there?

   ...ant

Re: Slow RMI Host start up

Posted by Raymond Feng <en...@gmail.com>.
I'll give a try.

Thanks,
Raymond

--------------------------------------------------
From: "ant elder" <an...@apache.org>
Sent: Tuesday, October 06, 2009 1:21 AM
To: <de...@tuscany.apache.org>
Subject: Re: Slow RMI Host start up

> On Mon, Oct 5, 2009 at 4:54 PM, Raymond Feng <en...@gmail.com> wrote:
>
>
>>
>> Any idea that can be used to detect the existence of the RMI registry 
>> will
>> be welcome.
>>
>
> What about if it tries to create a new registry without first checking
> if one already exists? If there's already an existing one would that
> then fail right away as the port is in use and we could catch that and
> then try to get the existing registry.
>
>   ...ant 


Re: Slow RMI Host start up

Posted by ant elder <an...@apache.org>.
On Mon, Oct 5, 2009 at 4:54 PM, Raymond Feng <en...@gmail.com> wrote:


>
> Any idea that can be used to detect the existence of the RMI registry will
> be welcome.
>

What about if it tries to create a new registry without first checking
if one already exists? If there's already an existing one would that
then fail right away as the port is in use and we could catch that and
then try to get the existing registry.

   ...ant

Re: Slow RMI Host start up

Posted by Raymond Feng <en...@gmail.com>.
Hi,

The code try to connect the RMI registry before it tries to create a new 
one. In some cases that I experienced, the connection hangs if the RMI 
registry is not available. I had to use a customized RMISocketFactory to 
control the timeout so that the call can at least return. Some operating 
systems reports the ConnectException before the timeout.

Any idea that can be used to detect the existence of the RMI registry will 
be welcome.

Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <an...@gmail.com>
Sent: Monday, October 05, 2009 3:31 AM
To: <de...@tuscany.apache.org>
Subject: Re: Slow RMI Host start up

> On Mon, Oct 5, 2009 at 9:03 AM, ant elder <an...@gmail.com> wrote:
>> The caclulator-rmi sample keeps failing on the hudson build as the
>> client runs before the service has finished starting up. I've stepped
>> through the code to try to find why its so slow and it turns out to be
>> "this.factory = SocketFactory.getDefault();" in the constructor of
>> org/apache/tuscany/sca/host/rmi/RMISocketFactoryImpl that takes all
>> the time, around 20 seconds on my machine. Before i go spending time
>> investigate whats going does anyone know what could be going on there?
>>
>>   ...ant
>>
>
> This has magically stopped happening for me now so i guess its some
> intermittent network issue, which is probably also why it only
> sometimes fails on the hudson build machine. Does anyone else ever see
> it - the calculator-rmi itest intermittently failing when you run a
> build? Or before it starting working fine I could also see the delay
> when running the calculator-rmi-service sample with mvn or in eclipse.
>
>  ...ant 


Re: Slow RMI Host start up

Posted by Simon Laws <si...@googlemail.com>.
It does ring a bell but it's working OK for me at the moment.

Simon

Re: Slow RMI Host start up

Posted by ant elder <an...@gmail.com>.
On Mon, Oct 5, 2009 at 9:03 AM, ant elder <an...@gmail.com> wrote:
> The caclulator-rmi sample keeps failing on the hudson build as the
> client runs before the service has finished starting up. I've stepped
> through the code to try to find why its so slow and it turns out to be
> "this.factory = SocketFactory.getDefault();" in the constructor of
> org/apache/tuscany/sca/host/rmi/RMISocketFactoryImpl that takes all
> the time, around 20 seconds on my machine. Before i go spending time
> investigate whats going does anyone know what could be going on there?
>
>   ...ant
>

This has magically stopped happening for me now so i guess its some
intermittent network issue, which is probably also why it only
sometimes fails on the hudson build machine. Does anyone else ever see
it - the calculator-rmi itest intermittently failing when you run a
build? Or before it starting working fine I could also see the delay
when running the calculator-rmi-service sample with mvn or in eclipse.

  ...ant

Re: Slow RMI Host start up

Posted by Simon Laws <si...@googlemail.com>.
Is there any security configured? I.e. is it doing some kind of
security handshakes? You quote a plain SocketFactory so I wouldn't
expect it to be firing up SSL but I don't know the innards well enough
I'm afraid.

Simon